ia-common 1.0.1-beta.21 → 1.0.1-beta.211
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/@enum.d.ts +29 -0
- package/build/@enum.js +29 -0
- package/build/@model.d.ts +17 -0
- package/build/@model.js +17 -0
- package/build/@type.d.ts +9 -0
- package/build/@type.js +9 -0
- package/build/@utils.d.ts +2 -0
- package/build/@utils.js +3 -0
- package/build/enum/advice-status.enum.d.ts +7 -0
- package/build/enum/advice-status.enum.js +11 -0
- package/build/enum/advice-type.enum.d.ts +6 -0
- package/build/enum/advice-type.enum.js +10 -0
- package/build/enum/advisor-user-mapping-type.enum.d.ts +4 -0
- package/build/enum/advisor-user-mapping-type.enum.js +8 -0
- package/build/enum/buy-back-type.enum.d.ts +4 -0
- package/build/enum/buy-back-type.enum.js +8 -0
- package/build/enum/configuration-description.enum.d.ts +3 -0
- package/build/enum/configuration-description.enum.js +7 -0
- package/build/enum/configuration-key.enum.d.ts +8 -0
- package/build/enum/configuration-key.enum.js +25 -0
- package/build/enum/configuration-text.enum.d.ts +3 -0
- package/build/enum/configuration-text.enum.js +7 -0
- package/build/enum/corporate-action-advice-status.enum.d.ts +6 -0
- package/build/enum/corporate-action-advice-status.enum.js +10 -0
- package/build/enum/corporate-actions-advice-transaction-type.enum.d.ts +5 -0
- package/build/enum/corporate-actions-advice-transaction-type.enum.js +9 -0
- package/build/enum/corporate-actions-status.enum.d.ts +5 -0
- package/build/enum/corporate-actions-status.enum.js +9 -0
- package/build/enum/corporate-actions-type.enum.d.ts +13 -0
- package/build/enum/corporate-actions-type.enum.js +17 -0
- package/build/enum/cron-job-name.enum.d.ts +3 -0
- package/build/enum/cron-job-name.enum.js +7 -0
- package/build/enum/cron-job-status.enum.d.ts +5 -0
- package/build/enum/cron-job-status.enum.js +9 -0
- package/build/enum/investment-duration-type.enum.d.ts +5 -0
- package/build/enum/investment-duration-type.enum.js +9 -0
- package/build/enum/ipo-advice-transaction-type.enum.d.ts +4 -0
- package/build/enum/ipo-advice-transaction-type.enum.js +8 -0
- package/build/enum/ipo-listing-exchange.enum.d.ts +6 -0
- package/build/enum/ipo-listing-exchange.enum.js +10 -0
- package/build/enum/ipo-listing-platform.enum.d.ts +5 -0
- package/build/enum/ipo-listing-platform.enum.js +9 -0
- package/build/enum/kafka-topics.enum.d.ts +5 -0
- package/build/enum/kafka-topics.enum.js +9 -0
- package/build/enum/mutual-fund-advice-duration.enum.d.ts +4 -0
- package/build/enum/mutual-fund-advice-duration.enum.js +8 -0
- package/build/enum/mutual-fund-advice-type.enum.d.ts +5 -0
- package/build/enum/mutual-fund-advice-type.enum.js +9 -0
- package/build/enum/mutual-fund-status.enum.d.ts +6 -0
- package/build/enum/mutual-fund-status.enum.js +10 -0
- package/build/enum/mutual-funds-risk.enum.d.ts +7 -0
- package/build/enum/mutual-funds-risk.enum.js +11 -0
- package/build/enum/mutual-funds-type.enum.d.ts +7 -0
- package/build/enum/mutual-funds-type.enum.js +11 -0
- package/build/enum/nfo-advice-status.enum.d.ts +6 -0
- package/build/enum/nfo-advice-status.enum.js +10 -0
- package/build/enum/nfo-advice-transaction-type.enum.d.ts +4 -0
- package/build/enum/nfo-advice-transaction-type.enum.js +8 -0
- package/build/enum/owner-operation-type.enum.d.ts +3 -0
- package/build/enum/owner-operation-type.enum.js +7 -0
- package/build/enum/split-and-bonus-stock-order.enum.d.ts +4 -0
- package/build/enum/split-and-bonus-stock-order.enum.js +8 -0
- package/build/enum/time-zone.enum.d.ts +3 -0
- package/build/enum/time-zone.enum.js +7 -0
- package/build/enum/transaction-type.enum.d.ts +5 -0
- package/build/enum/transaction-type.enum.js +9 -0
- package/build/enum/user-type.enum.d.ts +4 -1
- package/build/enum/user-type.enum.js +3 -0
- package/build/interface/advice-file-documents.interface.d.ts +8 -0
- package/build/interface/api/add-ipo.interface.d.ts +13 -0
- package/build/interface/api/add-mutual-funds.interface.d.ts +8 -0
- package/build/interface/api/advisor-user-mapping-entity.interface.d.ts +6 -0
- package/build/interface/api/advisor-user-mapping-entity.interface.js +2 -0
- package/build/interface/api/base-corporate-actions.interface.d.ts +7 -0
- package/build/interface/api/base-corporate-actions.interface.js +2 -0
- package/build/interface/api/create-advice.interface.d.ts +21 -0
- package/build/interface/api/create-advice.interface.js +2 -0
- package/build/interface/api/create-bonus-stock.interface.d.ts +6 -0
- package/build/interface/api/create-bonus-stock.interface.js +2 -0
- package/build/interface/api/create-bulk-advice-using-csv.interface.d.ts +7 -0
- package/build/interface/api/create-bulk-advice-using-csv.interface.js +2 -0
- package/build/interface/api/create-buy-back-interface.d.ts +6 -0
- package/build/interface/api/create-buy-back-interface.js +2 -0
- package/build/interface/api/create-client.interface.d.ts +12 -0
- package/build/interface/api/create-client.interface.js +2 -0
- package/build/interface/api/create-corporate-action-advice.interface.d.ts +8 -0
- package/build/interface/api/create-corporate-action-advice.interface.js +2 -0
- package/build/interface/api/create-delisting.interface.d.ts +6 -0
- package/build/interface/api/create-delisting.interface.js +2 -0
- package/build/interface/api/create-dividend-interface.d.ts +6 -0
- package/build/interface/api/create-dividend-interface.js +2 -0
- package/build/interface/api/create-fpo.interface.d.ts +6 -0
- package/build/interface/api/create-fpo.interface.js +2 -0
- package/build/interface/api/create-ipo-advice.interface.d.ts +14 -0
- package/build/interface/api/create-ipo-advice.interface.js +2 -0
- package/build/interface/api/create-ipo.interface.d.ts +6 -0
- package/build/interface/api/create-ipo.interface.js +2 -0
- package/build/interface/api/create-mutual-fund-advice.interface.d.ts +17 -0
- package/build/interface/api/create-mutual-fund-advice.interface.js +2 -0
- package/build/interface/api/create-nfo-advice.interface.d.ts +13 -0
- package/build/interface/api/create-nfo-advice.interface.js +2 -0
- package/build/interface/api/create-nfo.interface.d.ts +12 -0
- package/build/interface/api/create-nfo.interface.js +2 -0
- package/build/interface/api/create-ofs.interface.d.ts +6 -0
- package/build/interface/api/create-ofs.interface.js +2 -0
- package/build/interface/api/create-open-offer.interface.d.ts +6 -0
- package/build/interface/api/create-open-offer.interface.js +2 -0
- package/build/interface/api/create-pricing-plan.interface.d.ts +1 -0
- package/build/interface/api/create-registration.interface.d.ts +0 -2
- package/build/interface/api/create-right-issue.interface.d.ts +6 -0
- package/build/interface/api/create-right-issue.interface.js +2 -0
- package/build/interface/api/create-split-bonus-stock.interface.d.ts +6 -0
- package/build/interface/api/create-split-bonus-stock.interface.js +2 -0
- package/build/interface/api/create-split-stock.interface.d.ts +6 -0
- package/build/interface/api/create-split-stock.interface.js +2 -0
- package/build/interface/api/create-staff-dto.d.ts +9 -0
- package/build/interface/api/create-staff-dto.js +2 -0
- package/build/interface/api/create-subscription.interface.d.ts +11 -0
- package/build/interface/api/{remove-bank-details-by-id.interface.d.ts → delete-bank-details-by-id.interface.d.ts} +1 -1
- package/build/interface/api/delete-bank-details-by-id.interface.js +2 -0
- package/build/interface/api/{remove-pricing-plan-by-id.interface.d.ts → delete-pricing-plan-by-id.interface.d.ts} +1 -1
- package/build/interface/api/delete-pricing-plan-by-id.interface.js +2 -0
- package/build/interface/api/get-advice-by-id.interface.d.ts +5 -0
- package/build/interface/api/get-advice-by-id.interface.js +2 -0
- package/build/interface/api/get-advice-by-ids-status.inteface.d.ts +5 -0
- package/build/interface/api/get-advice-by-ids-status.inteface.js +2 -0
- package/build/interface/api/get-corporate-action-advice.interface.d.ts +4 -0
- package/build/interface/api/get-corporate-action-advice.interface.js +2 -0
- package/build/interface/api/get-corporate-actions.interface.d.ts +22 -0
- package/build/interface/api/get-corporate-actions.interface.js +3 -0
- package/build/interface/api/get-ipo-by-issue-end-date.interface.d.ts +4 -0
- package/build/interface/api/get-ipo-by-issue-end-date.interface.js +2 -0
- package/build/interface/api/get-mutual-funds-by-type.interface.d.ts +4 -0
- package/build/interface/api/get-mutual-funds-by-type.interface.js +2 -0
- package/build/interface/api/get-nfo-advice.interface.d.ts +4 -0
- package/build/interface/api/get-nfo-advice.interface.js +2 -0
- package/build/interface/api/get-nfo.interface.d.ts +4 -0
- package/build/interface/api/get-nfo.interface.js +2 -0
- package/build/interface/api/get-organization-by-id.interface.d.ts +6 -0
- package/build/interface/api/get-organization-by-id.interface.js +2 -0
- package/build/interface/api/get-organization-entities.interface.d.ts +9 -0
- package/build/interface/api/get-organization-entities.interface.js +2 -0
- package/build/interface/api/get-pricing-plan-by-date.interface.d.ts +2 -13
- package/build/interface/api/get-registration-by-id.interface.d.ts +1 -1
- package/build/interface/api/get-registration-with-organization-owners.interface.d.ts +1 -1
- package/build/interface/api/get-staff-members.interface.d.ts +10 -0
- package/build/interface/api/get-staff-members.interface.js +2 -0
- package/build/interface/api/get-user-entities-by-advisor-id-type.interface.d.ts +4 -0
- package/build/interface/api/get-user-entities-by-advisor-id-type.interface.js +2 -0
- package/build/interface/api/index.d.ts +57 -2
- package/build/interface/api/index.js +57 -2
- package/build/interface/api/remove-staff-member.interface.d.ts +3 -0
- package/build/interface/api/remove-staff-member.interface.js +2 -0
- package/build/interface/api/update-advice.interface.d.ts +20 -0
- package/build/interface/api/update-advice.interface.js +2 -0
- package/build/interface/api/update-bonus-stock.interface.d.ts +6 -0
- package/build/interface/api/update-bonus-stock.interface.js +2 -0
- package/build/interface/api/update-buy-back.interface.d.ts +6 -0
- package/build/interface/api/update-buy-back.interface.js +2 -0
- package/build/interface/api/update-corporate-action-advice.interface.d.ts +9 -0
- package/build/interface/api/update-corporate-action-advice.interface.js +2 -0
- package/build/interface/api/update-corporate-action.interface.d.ts +8 -0
- package/build/interface/api/update-corporate-action.interface.js +2 -0
- package/build/interface/api/update-delisting.interface.d.ts +5 -0
- package/build/interface/api/update-delisting.interface.js +2 -0
- package/build/interface/api/update-dividend.interface.d.ts +6 -0
- package/build/interface/api/update-dividend.interface.js +2 -0
- package/build/interface/api/update-fpo.interface.d.ts +6 -0
- package/build/interface/api/update-fpo.interface.js +2 -0
- package/build/interface/api/update-ipo.interface.d.ts +6 -0
- package/build/interface/api/update-ipo.interface.js +2 -0
- package/build/interface/api/update-nfo-advice.interface.d.ts +14 -0
- package/build/interface/api/update-nfo-advice.interface.js +2 -0
- package/build/interface/api/update-ofs.interface.d.ts +6 -0
- package/build/interface/api/update-ofs.interface.js +2 -0
- package/build/interface/api/update-open-offer.interface.d.ts +6 -0
- package/build/interface/api/update-open-offer.interface.js +2 -0
- package/build/interface/api/update-organization.interface.d.ts +3 -0
- package/build/interface/api/update-right-issue.interface.d.ts +6 -0
- package/build/interface/api/update-right-issue.interface.js +2 -0
- package/build/interface/api/update-split-bonus.interface.d.ts +6 -0
- package/build/interface/api/update-split-bonus.interface.js +2 -0
- package/build/interface/api/update-split-stock.interface.d.ts +6 -0
- package/build/interface/api/update-split-stock.interface.js +2 -0
- package/build/interface/api/update-staff.dto.d.ts +9 -0
- package/build/interface/api/update-staff.dto.js +2 -0
- package/build/interface/corporate-actions/bonus-corporate-actions.interface.d.ts +5 -0
- package/build/interface/corporate-actions/bonus-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/bonus-stock-data.interface.d.ts +4 -0
- package/build/interface/corporate-actions/bonus-stock-data.interface.js +2 -0
- package/build/interface/corporate-actions/buy-back-corporate-actions.interface.d.ts +8 -0
- package/build/interface/corporate-actions/buy-back-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/corporate-entity-omit-data.interface.d.ts +2 -0
- package/build/interface/corporate-actions/corporate-entity-omit-data.interface.js +2 -0
- package/build/interface/corporate-actions/delisting-corporate-actions.interface.d.ts +6 -0
- package/build/interface/corporate-actions/delisting-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/dividend-corporate-actions.interface.d.ts +6 -0
- package/build/interface/corporate-actions/dividend-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/fpo-corporate-actions.interface.d.ts +7 -0
- package/build/interface/corporate-actions/fpo-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/index.d.ts +14 -0
- package/build/interface/corporate-actions/index.js +30 -0
- package/build/interface/corporate-actions/ipo-corporate-action.interface.d.ts +9 -0
- package/build/interface/corporate-actions/ipo-corporate-action.interface.js +2 -0
- package/build/interface/corporate-actions/ofs-corporate-actions.interface.d.ts +6 -0
- package/build/interface/corporate-actions/ofs-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/open-offer-corporate-actions.interface.d.ts +6 -0
- package/build/interface/corporate-actions/open-offer-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/right-issues-corporate-actions.interface.d.ts +8 -0
- package/build/interface/corporate-actions/right-issues-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/split-bonus-corporate-action.interface.d.ts +7 -0
- package/build/interface/corporate-actions/split-bonus-corporate-action.interface.js +2 -0
- package/build/interface/corporate-actions/split-stock-corporate-actions.interface.d.ts +5 -0
- package/build/interface/corporate-actions/split-stock-corporate-actions.interface.js +2 -0
- package/build/interface/corporate-actions/split-stock-data.interface.d.ts +4 -0
- package/build/interface/corporate-actions/split-stock-data.interface.js +2 -0
- package/build/interface/entity/advice-entity.interface.d.ts +20 -0
- package/build/interface/entity/advice-entity.interface.js +2 -0
- package/build/interface/entity/configurations-entity.interface.d.ts +9 -0
- package/build/interface/entity/configurations-entity.interface.js +2 -0
- package/build/interface/entity/corporate-action-advice-entity.interface.d.ts +14 -0
- package/build/interface/entity/corporate-action-advice-entity.interface.js +2 -0
- package/build/interface/entity/corporate-actions-entity.interface.d.ts +5 -0
- package/build/interface/entity/corporate-actions-entity.interface.js +2 -0
- package/build/interface/entity/cron-job-entity.interface.d.ts +11 -0
- package/build/interface/entity/cron-job-entity.interface.js +2 -0
- package/build/interface/entity/equity-advice-in-process-entity.interface.d.ts +15 -0
- package/build/interface/entity/equity-advice-in-process-entity.interface.js +2 -0
- package/build/interface/entity/index.d.ts +13 -0
- package/build/interface/entity/index.js +13 -0
- package/build/interface/entity/ipo-advice-entity.interface.d.ts +16 -0
- package/build/interface/entity/ipo-advice-entity.interface.js +2 -0
- package/build/interface/entity/ipo-entity.interface.d.ts +11 -0
- package/build/interface/entity/ipo-entity.interface.js +2 -0
- package/build/interface/entity/mutual-fund-advice-entity.interface.d.ts +19 -0
- package/build/interface/entity/mutual-fund-advice-entity.interface.js +2 -0
- package/build/interface/entity/mutual-funds-entity.interface.d.ts +17 -0
- package/build/interface/entity/mutual-funds-entity.interface.js +2 -0
- package/build/interface/entity/nfo-entity.interface.d.ts +10 -0
- package/build/interface/entity/nfo-entity.interface.js +2 -0
- package/build/interface/entity/nfp-advice-entity.interface.d.ts +14 -0
- package/build/interface/entity/nfp-advice-entity.interface.js +2 -0
- package/build/interface/entity/organization-entity.interface.d.ts +1 -0
- package/build/interface/entity/user-entity.interface.d.ts +1 -0
- package/build/interface/last-trade.interface.d.ts +4 -0
- package/build/interface/last-trade.interface.js +2 -0
- package/build/interface/model/organization-entity-model.interface.d.ts +11 -0
- package/build/interface/model/organization-entity-model.interface.js +2 -0
- package/build/interface/ng-date-struct.interface.d.ts +5 -0
- package/build/interface/ng-date-struct.interface.js +2 -0
- package/build/interface/pricing-plan-model.interface.d.ts +10 -0
- package/build/interface/pricing-plan-model.interface.js +2 -0
- package/build/interface/selected-billing-cycle.interface.d.ts +7 -0
- package/build/interface/selected-billing-cycle.interface.js +2 -0
- package/build/interface/stock-advice.interface.d.ts +8 -0
- package/build/interface/stock-advice.interface.js +2 -0
- package/build/interface/subscription-data.inteface.d.ts +4 -0
- package/build/interface/subscription-data.inteface.js +2 -0
- package/build/interface/tree-value.interface.d.ts +5 -0
- package/build/interface/tree-value.interface.js +2 -0
- package/build/interface/update-user-info.interface.d.ts +2 -2
- package/build/model/bank-details-entity-model.d.ts +19 -0
- package/build/model/bank-details-entity-model.js +18 -0
- package/build/model/bonus-corporate-action-model.d.ts +17 -0
- package/build/model/bonus-corporate-action-model.js +31 -0
- package/build/model/buy-back-corporate-action-model.d.ts +19 -0
- package/build/model/buy-back-corporate-action-model.js +44 -0
- package/build/model/configurations-entity-model.d.ts +16 -0
- package/build/model/configurations-entity-model.js +17 -0
- package/build/model/corporate-action-model.d.ts +37 -0
- package/build/model/corporate-action-model.js +54 -0
- package/build/model/delisting-corporate-action-model.d.ts +18 -0
- package/build/model/delisting-corporate-action-model.js +32 -0
- package/build/model/dividend-corporate-action-model.d.ts +18 -0
- package/build/model/dividend-corporate-action-model.js +43 -0
- package/build/model/fpo-corporate-action-model.d.ts +21 -0
- package/build/model/fpo-corporate-action-model.js +33 -0
- package/build/model/ipo-corporate-action-model.d.ts +20 -0
- package/build/model/ipo-corporate-action-model.js +34 -0
- package/build/model/ofs-corporate-action-model.d.ts +18 -0
- package/build/model/ofs-corporate-action-model.js +32 -0
- package/build/model/open-offer-corporate-action-model.d.ts +18 -0
- package/build/model/open-offer-corporate-action-model.js +32 -0
- package/build/model/organization-entity-model.d.ts +36 -0
- package/build/model/organization-entity-model.js +69 -0
- package/build/model/pricing-plan-entity-model.d.ts +5 -40
- package/build/model/pricing-plan-entity-model.js +47 -31
- package/build/model/pricing-plan-model.d.ts +21 -0
- package/build/model/pricing-plan-model.js +63 -0
- package/build/model/right-issue-corporate-action-model.d.ts +20 -0
- package/build/model/right-issue-corporate-action-model.js +34 -0
- package/build/model/split-bonus-corporate-action-model.d.ts +18 -0
- package/build/model/split-bonus-corporate-action-model.js +35 -0
- package/build/model/split-corporate-action-model.d.ts +17 -0
- package/build/model/split-corporate-action-model.js +31 -0
- package/build/model/subscribed-pricing-plan-model.d.ts +17 -10
- package/build/model/subscribed-pricing-plan-model.js +50 -32
- package/build/model/subscription-entity-model.d.ts +25 -0
- package/build/model/subscription-entity-model.js +58 -0
- package/build/model/user-entity-model.d.ts +26 -0
- package/build/model/user-entity-model.js +36 -0
- package/build/red-black-tree/js-cols.d.ts +0 -0
- package/build/red-black-tree/js-cols.js +6259 -0
- package/build/red-black-tree/red-black-tree.d.ts +11 -0
- package/build/red-black-tree/red-black-tree.js +56 -0
- package/build/utils/date-util.d.ts +14 -0
- package/build/utils/date-util.js +51 -0
- package/build/utils/string-utils.d.ts +6 -0
- package/build/utils/string-utils.js +18 -0
- package/build/utils/validate-utils.d.ts +4 -0
- package/build/utils/validate-utils.js +20 -0
- package/package.json +1 -1
- package/build/interface/api/login-interface.d.ts +0 -22
- /package/build/interface/{api/login-interface.js → advice-file-documents.interface.js} +0 -0
- /package/build/interface/api/{remove-bank-details-by-id.interface.js → add-ipo.interface.js} +0 -0
- /package/build/interface/api/{remove-pricing-plan-by-id.interface.js → add-mutual-funds.interface.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PricingPlanStatus } from "../@enum";
|
|
2
|
-
import { IGetPricingPlanByDateResponse, IPricingPlanEntity } from "../@type";
|
|
3
|
-
export declare class PricingPlanEntityModel {
|
|
2
|
+
import { IBillingCycle, IGetPricingPlanByDateResponse, IPricingPlanEntity } from "../@type";
|
|
3
|
+
export declare class PricingPlanEntityModel implements IPricingPlanEntity {
|
|
4
4
|
id: number;
|
|
5
5
|
effectiveFrom: number;
|
|
6
6
|
effectiveTo: number;
|
|
@@ -13,6 +13,9 @@ export declare class PricingPlanEntityModel {
|
|
|
13
13
|
billingCycle: string;
|
|
14
14
|
constructor(data: IPricingPlanEntity);
|
|
15
15
|
toObject(): IGetPricingPlanByDateResponse;
|
|
16
|
+
static getBillingCycleString(billingCycle: IBillingCycle): string;
|
|
17
|
+
static validateNoOfMonthsByBillingCycle(billingCycle: IBillingCycle): void;
|
|
18
|
+
static validateBillingCycleIndexByBillingCycle(billingCycle: IBillingCycle): void;
|
|
16
19
|
}
|
|
17
20
|
export declare class BillingCycleModel {
|
|
18
21
|
code: string;
|
|
@@ -25,41 +28,3 @@ export declare class BillingCycleModel {
|
|
|
25
28
|
getDiscount(): number;
|
|
26
29
|
getKey(): string;
|
|
27
30
|
}
|
|
28
|
-
export interface IPricingPlanModel {
|
|
29
|
-
id: number;
|
|
30
|
-
effectiveFromDate: number;
|
|
31
|
-
effectiveToDate: number;
|
|
32
|
-
basePrice: number;
|
|
33
|
-
billingCycle: {
|
|
34
|
-
[key: string]: {
|
|
35
|
-
noOfMonths: number;
|
|
36
|
-
discount: string;
|
|
37
|
-
name: string;
|
|
38
|
-
key: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export declare class PricingPlanModel implements IPricingPlanModel {
|
|
43
|
-
id: number;
|
|
44
|
-
effectiveFromDate: number;
|
|
45
|
-
effectiveToDate: number;
|
|
46
|
-
basePrice: number;
|
|
47
|
-
billingCycle: {
|
|
48
|
-
[key: string]: {
|
|
49
|
-
noOfMonths: number;
|
|
50
|
-
discount: string;
|
|
51
|
-
name: string;
|
|
52
|
-
key: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
constructor(data: IGetPricingPlanByDateResponse);
|
|
56
|
-
getBillingCycleKeys(): string[];
|
|
57
|
-
getNoOfSubscriptionDays(type: string): number;
|
|
58
|
-
getBillCycleByKey(type: string): {
|
|
59
|
-
noOfMonths: number;
|
|
60
|
-
discount: string;
|
|
61
|
-
name: string;
|
|
62
|
-
key: string;
|
|
63
|
-
};
|
|
64
|
-
validateBillingCycleKey(key: string): void;
|
|
65
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
3
|
+
exports.BillingCycleModel = exports.PricingPlanEntityModel = void 0;
|
|
4
|
+
var _model_1 = require("../@model");
|
|
5
5
|
var PricingPlanEntityModel = /** @class */ (function () {
|
|
6
6
|
function PricingPlanEntityModel(data) {
|
|
7
7
|
Object.assign(this, data);
|
|
@@ -20,8 +20,9 @@ var PricingPlanEntityModel = /** @class */ (function () {
|
|
|
20
20
|
responseObj.billingCycle[index] = {
|
|
21
21
|
noOfMonths: Number(billingArray[0]),
|
|
22
22
|
discount: billingArray[1],
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
value: parseFloat(billingArray[2]),
|
|
24
|
+
name: billingArray.slice(3).join("_"),
|
|
25
|
+
key: billingArray.slice(3).join("-").toLowerCase().replace(/ /g, "-"),
|
|
25
26
|
};
|
|
26
27
|
});
|
|
27
28
|
responseObj.effectiveFromDate = this.effectiveFrom;
|
|
@@ -29,6 +30,48 @@ var PricingPlanEntityModel = /** @class */ (function () {
|
|
|
29
30
|
responseObj.basePrice = this.basePrice;
|
|
30
31
|
return responseObj;
|
|
31
32
|
};
|
|
33
|
+
PricingPlanEntityModel.getBillingCycleString = function (billingCycle) {
|
|
34
|
+
var billingCycles = [];
|
|
35
|
+
Object.values(billingCycle).forEach(function (billing) {
|
|
36
|
+
billingCycles.push("".concat(billing.noOfMonths, "_").concat(billing.discount, "_").concat(billing.value, "_").concat(billing.name));
|
|
37
|
+
});
|
|
38
|
+
return billingCycles.join(",");
|
|
39
|
+
};
|
|
40
|
+
PricingPlanEntityModel.validateNoOfMonthsByBillingCycle = function (billingCycle) {
|
|
41
|
+
var billingCycleKeys = Object.keys(billingCycle);
|
|
42
|
+
var previousMonthCount = 0;
|
|
43
|
+
for (var _i = 0, billingCycleKeys_1 = billingCycleKeys; _i < billingCycleKeys_1.length; _i++) {
|
|
44
|
+
var key = billingCycleKeys_1[_i];
|
|
45
|
+
var billingCycleObj = billingCycle[key];
|
|
46
|
+
var currentMonthCount = billingCycleObj.noOfMonths;
|
|
47
|
+
if (previousMonthCount >= currentMonthCount && key != "0") {
|
|
48
|
+
throw new _model_1.AppBadRequestException({
|
|
49
|
+
key: "noOfMonths.".concat(key),
|
|
50
|
+
message: [
|
|
51
|
+
"No of months at index ".concat(key, " should be greater than ").concat(previousMonthCount),
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
previousMonthCount = currentMonthCount;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
PricingPlanEntityModel.validateBillingCycleIndexByBillingCycle = function (billingCycle) {
|
|
59
|
+
var billingCycleKeys = Object.keys(billingCycle);
|
|
60
|
+
for (var i = 0; i < billingCycleKeys.length; i++) {
|
|
61
|
+
var billingCycleIndex = Number(billingCycleKeys[i]);
|
|
62
|
+
if (billingCycleIndex !== 0) {
|
|
63
|
+
var recentBillingCycleIndex = Number(billingCycleKeys[i - 1]);
|
|
64
|
+
if (recentBillingCycleIndex !== billingCycleIndex - 1) {
|
|
65
|
+
throw new _model_1.AppBadRequestException({
|
|
66
|
+
key: "billingCycleIndex.".concat(billingCycleIndex),
|
|
67
|
+
message: [
|
|
68
|
+
"billingCycleIndex should be ".concat(recentBillingCycleIndex + 1, " at index ").concat(billingCycleIndex),
|
|
69
|
+
],
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
32
75
|
return PricingPlanEntityModel;
|
|
33
76
|
}());
|
|
34
77
|
exports.PricingPlanEntityModel = PricingPlanEntityModel;
|
|
@@ -57,30 +100,3 @@ var BillingCycleModel = /** @class */ (function () {
|
|
|
57
100
|
return BillingCycleModel;
|
|
58
101
|
}());
|
|
59
102
|
exports.BillingCycleModel = BillingCycleModel;
|
|
60
|
-
var PricingPlanModel = /** @class */ (function () {
|
|
61
|
-
function PricingPlanModel(data) {
|
|
62
|
-
Object.assign(this, data);
|
|
63
|
-
}
|
|
64
|
-
PricingPlanModel.prototype.getBillingCycleKeys = function () {
|
|
65
|
-
return Object.values(this.billingCycle).map(function (billingCycleObj) { return billingCycleObj.key; });
|
|
66
|
-
};
|
|
67
|
-
PricingPlanModel.prototype.getNoOfSubscriptionDays = function (type) {
|
|
68
|
-
var billingCycleModel = this.getBillCycleByKey(type);
|
|
69
|
-
return billingCycleModel.noOfMonths * 30 - 1;
|
|
70
|
-
};
|
|
71
|
-
PricingPlanModel.prototype.getBillCycleByKey = function (type) {
|
|
72
|
-
return Object.values(this.billingCycle).filter(function (billingCycleObj) { return billingCycleObj.key === type; })[0];
|
|
73
|
-
};
|
|
74
|
-
PricingPlanModel.prototype.validateBillingCycleKey = function (key) {
|
|
75
|
-
if (!this.getBillingCycleKeys().includes(key)) {
|
|
76
|
-
throw new app_badrequest_exception_1.AppBadRequestException({
|
|
77
|
-
key: "type",
|
|
78
|
-
message: [
|
|
79
|
-
"subscription with type:'".concat(key, "' is wrong,type should be one of the ").concat(this.getBillingCycleKeys()),
|
|
80
|
-
],
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
return PricingPlanModel;
|
|
85
|
-
}());
|
|
86
|
-
exports.PricingPlanModel = PricingPlanModel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IGetPricingPlanByDateResponse, IPricingPlanModel, IBillingCycleObj } from "../@type";
|
|
2
|
+
export declare class PricingPlanModel implements IPricingPlanModel {
|
|
3
|
+
id: number;
|
|
4
|
+
effectiveFromDate: number;
|
|
5
|
+
effectiveToDate: number;
|
|
6
|
+
basePrice: number;
|
|
7
|
+
billingCycle: {
|
|
8
|
+
[key: string]: IBillingCycleObj;
|
|
9
|
+
};
|
|
10
|
+
constructor(data: IGetPricingPlanByDateResponse);
|
|
11
|
+
getBillingCycleKeys(): string[];
|
|
12
|
+
validateBillingCycleKey(key: string): void;
|
|
13
|
+
getNoOfSubscriptionDays(type: string): number;
|
|
14
|
+
getBillCycleByKey(type: string): IBillingCycleObj;
|
|
15
|
+
getToDateCode(fromDateCode: number, billingCycleKey: string): number;
|
|
16
|
+
validateGetToDateCode(fromDateCode: number, toDateCode: number, billingCycleKey: string): number;
|
|
17
|
+
getFromToDateCode(billingCycleKey: string, offset?: number): {
|
|
18
|
+
fromDateCode: number;
|
|
19
|
+
toDateCode: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PricingPlanModel = void 0;
|
|
4
|
+
var _model_1 = require("../@model");
|
|
5
|
+
var _utils_1 = require("../@utils");
|
|
6
|
+
var PricingPlanModel = /** @class */ (function () {
|
|
7
|
+
function PricingPlanModel(data) {
|
|
8
|
+
Object.assign(this, data);
|
|
9
|
+
}
|
|
10
|
+
PricingPlanModel.prototype.getBillingCycleKeys = function () {
|
|
11
|
+
return Object.values(this.billingCycle).map(function (billingCycleObj) { return billingCycleObj.key; });
|
|
12
|
+
};
|
|
13
|
+
PricingPlanModel.prototype.validateBillingCycleKey = function (key) {
|
|
14
|
+
if (!this.getBillingCycleKeys().includes(key)) {
|
|
15
|
+
throw new _model_1.AppBadRequestException({
|
|
16
|
+
key: "type",
|
|
17
|
+
message: [
|
|
18
|
+
"subscription with type:'".concat(key, "' is wrong,type should be one of the ").concat(this.getBillingCycleKeys()),
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
PricingPlanModel.prototype.getNoOfSubscriptionDays = function (type) {
|
|
24
|
+
this.validateBillingCycleKey(type);
|
|
25
|
+
var billingCycleModel = this.getBillCycleByKey(type);
|
|
26
|
+
return billingCycleModel.noOfMonths * 30 - 1;
|
|
27
|
+
};
|
|
28
|
+
PricingPlanModel.prototype.getBillCycleByKey = function (type) {
|
|
29
|
+
this.validateBillingCycleKey(type);
|
|
30
|
+
return Object.values(this.billingCycle).filter(function (billingCycleObj) { return billingCycleObj.key === type; })[0];
|
|
31
|
+
};
|
|
32
|
+
PricingPlanModel.prototype.getToDateCode = function (fromDateCode, billingCycleKey) {
|
|
33
|
+
this.validateBillingCycleKey(billingCycleKey);
|
|
34
|
+
var copyFromDateCode = fromDateCode;
|
|
35
|
+
var newSubscriptionToDate = new Date(_utils_1.dateUtil.convertStringToDate(String(copyFromDateCode)));
|
|
36
|
+
newSubscriptionToDate.setDate(newSubscriptionToDate.getDate() +
|
|
37
|
+
this.getNoOfSubscriptionDays(billingCycleKey));
|
|
38
|
+
return Number(_utils_1.dateUtil.getDateCode(newSubscriptionToDate));
|
|
39
|
+
};
|
|
40
|
+
PricingPlanModel.prototype.validateGetToDateCode = function (fromDateCode, toDateCode, billingCycleKey) {
|
|
41
|
+
var calculatedToDateCode = this.getToDateCode(fromDateCode, billingCycleKey);
|
|
42
|
+
if (calculatedToDateCode != Number(toDateCode)) {
|
|
43
|
+
throw new _model_1.AppBadRequestException({
|
|
44
|
+
key: "to",
|
|
45
|
+
message: [
|
|
46
|
+
"calculated to Date:'".concat(calculatedToDateCode, "' is not matches with to date you entered"),
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return calculatedToDateCode;
|
|
51
|
+
};
|
|
52
|
+
PricingPlanModel.prototype.getFromToDateCode = function (billingCycleKey, offset) {
|
|
53
|
+
if (offset === void 0) { offset = 0; }
|
|
54
|
+
var fromDateCode = Number(_utils_1.dateUtil.addNDaysToDateCode(_utils_1.dateUtil.getTodayCode(), offset));
|
|
55
|
+
var toDateCode = this.getToDateCode(fromDateCode, billingCycleKey);
|
|
56
|
+
return {
|
|
57
|
+
fromDateCode: fromDateCode,
|
|
58
|
+
toDateCode: toDateCode,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
return PricingPlanModel;
|
|
62
|
+
}());
|
|
63
|
+
exports.PricingPlanModel = PricingPlanModel;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CorporateActionsStatus, CorporateActionsType } from "../@enum";
|
|
2
|
+
import { ICorporateActionsEntity, ICorporateEntityOmitData, IRightIssueCorporateAction } from "../@type";
|
|
3
|
+
export declare class RightIssueCorporateActionModel implements IRightIssueCorporateAction, ICorporateEntityOmitData {
|
|
4
|
+
price: number;
|
|
5
|
+
startDate: number;
|
|
6
|
+
endDate: number;
|
|
7
|
+
ratio: string;
|
|
8
|
+
companyName: string;
|
|
9
|
+
recordDate: number;
|
|
10
|
+
type: CorporateActionsType;
|
|
11
|
+
status: CorporateActionsStatus;
|
|
12
|
+
ratioInWord: string;
|
|
13
|
+
id: number;
|
|
14
|
+
createdOn: Date;
|
|
15
|
+
updatedOn: Date;
|
|
16
|
+
createdBy: number;
|
|
17
|
+
updatedBy: number;
|
|
18
|
+
constructor(entity: ICorporateActionsEntity);
|
|
19
|
+
getCorporateActionEntity(): ICorporateActionsEntity;
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.RightIssueCorporateActionModel = void 0;
|
|
15
|
+
var _enum_1 = require("../@enum");
|
|
16
|
+
var _utils_1 = require("../@utils");
|
|
17
|
+
var RightIssueCorporateActionModel = /** @class */ (function () {
|
|
18
|
+
function RightIssueCorporateActionModel(entity) {
|
|
19
|
+
_utils_1.ValidateUtils.validateCorporateActionType(entity.type, _enum_1.CorporateActionsType.RIGHTS_ISSUE);
|
|
20
|
+
Object.assign(this, __assign(__assign({}, entity), JSON.parse(entity.data)));
|
|
21
|
+
}
|
|
22
|
+
RightIssueCorporateActionModel.prototype.getCorporateActionEntity = function () {
|
|
23
|
+
var corporateActionEntity = __assign(__assign({}, this), { data: JSON.stringify({
|
|
24
|
+
ratio: this.ratio,
|
|
25
|
+
price: this.price,
|
|
26
|
+
startDate: this.startDate,
|
|
27
|
+
endDate: this.endDate,
|
|
28
|
+
ratioInWord: this.ratioInWord,
|
|
29
|
+
}) });
|
|
30
|
+
return corporateActionEntity;
|
|
31
|
+
};
|
|
32
|
+
return RightIssueCorporateActionModel;
|
|
33
|
+
}());
|
|
34
|
+
exports.RightIssueCorporateActionModel = RightIssueCorporateActionModel;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CorporateActionsStatus, CorporateActionsType, OrderOfSplitAndBonusStock } from "../@enum";
|
|
2
|
+
import { IBonusStockData, ICorporateActionsEntity, ICorporateEntityOmitData, ISplitBonusCorporateAction, ISplitStockData } from "../@type";
|
|
3
|
+
export declare class SplitBonusCorporateActionModel implements ISplitBonusCorporateAction, ICorporateEntityOmitData {
|
|
4
|
+
splitStock: ISplitStockData;
|
|
5
|
+
bonusStock: IBonusStockData;
|
|
6
|
+
order: OrderOfSplitAndBonusStock;
|
|
7
|
+
companyName: string;
|
|
8
|
+
recordDate: number;
|
|
9
|
+
type: CorporateActionsType;
|
|
10
|
+
status: CorporateActionsStatus;
|
|
11
|
+
id: number;
|
|
12
|
+
createdOn: Date;
|
|
13
|
+
updatedOn: Date;
|
|
14
|
+
createdBy: number;
|
|
15
|
+
updatedBy: number;
|
|
16
|
+
constructor(entity: ICorporateActionsEntity);
|
|
17
|
+
getCorporateActionEntity(): ICorporateActionsEntity;
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SplitBonusCorporateActionModel = void 0;
|
|
15
|
+
var SplitBonusCorporateActionModel = /** @class */ (function () {
|
|
16
|
+
function SplitBonusCorporateActionModel(entity) {
|
|
17
|
+
Object.assign(this, __assign(__assign({}, entity), JSON.parse(entity.data)));
|
|
18
|
+
}
|
|
19
|
+
SplitBonusCorporateActionModel.prototype.getCorporateActionEntity = function () {
|
|
20
|
+
var corporateActionEntity = __assign(__assign({}, this), { data: JSON.stringify({
|
|
21
|
+
splitStock: {
|
|
22
|
+
currentFV: this.splitStock.currentFV,
|
|
23
|
+
newFV: this.splitStock.newFV,
|
|
24
|
+
},
|
|
25
|
+
bonusStock: {
|
|
26
|
+
ratio: this.bonusStock.ratio,
|
|
27
|
+
ratioInWords: this.bonusStock.ratioInWords,
|
|
28
|
+
},
|
|
29
|
+
order: this.order,
|
|
30
|
+
}) });
|
|
31
|
+
return corporateActionEntity;
|
|
32
|
+
};
|
|
33
|
+
return SplitBonusCorporateActionModel;
|
|
34
|
+
}());
|
|
35
|
+
exports.SplitBonusCorporateActionModel = SplitBonusCorporateActionModel;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CorporateActionsStatus, CorporateActionsType } from "../@enum";
|
|
2
|
+
import { ICorporateActionsEntity, ICorporateEntityOmitData, ISplitCorporateAction } from "../@type";
|
|
3
|
+
export declare class SplitCorporateActionModel implements ISplitCorporateAction, ICorporateEntityOmitData {
|
|
4
|
+
currentFV: number;
|
|
5
|
+
newFV: number;
|
|
6
|
+
companyName: string;
|
|
7
|
+
recordDate: number;
|
|
8
|
+
type: CorporateActionsType;
|
|
9
|
+
status: CorporateActionsStatus;
|
|
10
|
+
id: number;
|
|
11
|
+
createdOn: Date;
|
|
12
|
+
updatedOn: Date;
|
|
13
|
+
createdBy: number;
|
|
14
|
+
updatedBy: number;
|
|
15
|
+
constructor(entity: ICorporateActionsEntity);
|
|
16
|
+
getCorporateActionEntity(): ICorporateActionsEntity;
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SplitCorporateActionModel = void 0;
|
|
15
|
+
var _enum_1 = require("../@enum");
|
|
16
|
+
var _utils_1 = require("../@utils");
|
|
17
|
+
var SplitCorporateActionModel = /** @class */ (function () {
|
|
18
|
+
function SplitCorporateActionModel(entity) {
|
|
19
|
+
_utils_1.ValidateUtils.validateCorporateActionType(entity.type, _enum_1.CorporateActionsType.SPLIT);
|
|
20
|
+
Object.assign(this, __assign(__assign({}, entity), JSON.parse(entity.data)));
|
|
21
|
+
}
|
|
22
|
+
SplitCorporateActionModel.prototype.getCorporateActionEntity = function () {
|
|
23
|
+
var corporateActionEntity = __assign(__assign({}, this), { data: JSON.stringify({
|
|
24
|
+
currentFV: this.currentFV,
|
|
25
|
+
newFV: this.newFV,
|
|
26
|
+
}) });
|
|
27
|
+
return corporateActionEntity;
|
|
28
|
+
};
|
|
29
|
+
return SplitCorporateActionModel;
|
|
30
|
+
}());
|
|
31
|
+
exports.SplitCorporateActionModel = SplitCorporateActionModel;
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { IBillingCycleObj } from "../@type";
|
|
2
|
+
import { PricingPlanModel } from "./pricing-plan-model";
|
|
3
|
+
export declare class SubscribedPricingPlanModel {
|
|
3
4
|
billingCycleKey: string;
|
|
4
|
-
selectedBillingCycle:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
name: string;
|
|
8
|
-
key: string;
|
|
9
|
-
};
|
|
10
|
-
selectedPitchSlabBasePrice: number;
|
|
5
|
+
selectedBillingCycle: IBillingCycleObj;
|
|
6
|
+
basePrice: number;
|
|
7
|
+
pricingPlanModel: PricingPlanModel;
|
|
11
8
|
constructor(data: PricingPlanModel, billingCycleKey: string);
|
|
12
|
-
getBasePrice(): number;
|
|
13
9
|
getGrossAmount(config?: {
|
|
14
10
|
roundDown: boolean;
|
|
15
11
|
}): number;
|
|
12
|
+
getNextBillingCycleDateRange(): {
|
|
13
|
+
subscriptionDays: number;
|
|
14
|
+
date: string;
|
|
15
|
+
};
|
|
16
16
|
getNetAmount(config?: {
|
|
17
17
|
roundDown: boolean;
|
|
18
18
|
}): number;
|
|
19
19
|
getBillingDiscount(): number;
|
|
20
|
+
validateGrossAmount(grossAmount: number, config?: {
|
|
21
|
+
roundDown: boolean;
|
|
22
|
+
}): number;
|
|
23
|
+
validateNetAmount(netAmount: number, config?: {
|
|
24
|
+
roundDown: boolean;
|
|
25
|
+
}): number;
|
|
26
|
+
validateGetBillingCycleDiscount(discount: string): number;
|
|
20
27
|
}
|
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.SubscribedPricingPlanModel = void 0;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
|
|
4
|
+
var _model_1 = require("../@model");
|
|
5
|
+
var _utils_1 = require("../@utils");
|
|
6
|
+
var SubscribedPricingPlanModel = /** @class */ (function () {
|
|
22
7
|
function SubscribedPricingPlanModel(data, billingCycleKey) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
this.basePrice = data.basePrice;
|
|
9
|
+
this.billingCycleKey = billingCycleKey;
|
|
10
|
+
this.selectedBillingCycle = data.getBillCycleByKey(billingCycleKey);
|
|
11
|
+
this.pricingPlanModel = data;
|
|
27
12
|
}
|
|
28
|
-
SubscribedPricingPlanModel.prototype.getBasePrice = function () {
|
|
29
|
-
return this.selectedPitchSlabBasePrice;
|
|
30
|
-
};
|
|
31
13
|
SubscribedPricingPlanModel.prototype.getGrossAmount = function (config) {
|
|
32
14
|
if (config === void 0) { config = { roundDown: false }; }
|
|
33
15
|
var roundDown = config.roundDown;
|
|
@@ -38,18 +20,19 @@ var SubscribedPricingPlanModel = /** @class */ (function (_super) {
|
|
|
38
20
|
return Math.round(this.basePrice * this.selectedBillingCycle.noOfMonths);
|
|
39
21
|
}
|
|
40
22
|
};
|
|
23
|
+
SubscribedPricingPlanModel.prototype.getNextBillingCycleDateRange = function () {
|
|
24
|
+
var subscriptionDays = this.pricingPlanModel.getNoOfSubscriptionDays(this.billingCycleKey);
|
|
25
|
+
var date = _utils_1.dateUtil.addNDaysToDateCode(_utils_1.dateUtil.getDateCode(new Date()), subscriptionDays);
|
|
26
|
+
return { subscriptionDays: subscriptionDays, date: date };
|
|
27
|
+
};
|
|
41
28
|
SubscribedPricingPlanModel.prototype.getNetAmount = function (config) {
|
|
42
29
|
if (config === void 0) { config = { roundDown: false }; }
|
|
43
30
|
var roundDown = config.roundDown;
|
|
44
31
|
if (roundDown) {
|
|
45
|
-
return Math.floor(this.
|
|
46
|
-
(1 - this.getBillingDiscount() / 100) *
|
|
47
|
-
this.selectedBillingCycle.noOfMonths);
|
|
32
|
+
return Math.floor(this.selectedBillingCycle.value * this.selectedBillingCycle.noOfMonths);
|
|
48
33
|
}
|
|
49
34
|
else {
|
|
50
|
-
return Math.round(this.
|
|
51
|
-
(1 - this.getBillingDiscount() / 100) *
|
|
52
|
-
this.selectedBillingCycle.noOfMonths);
|
|
35
|
+
return Math.round(this.selectedBillingCycle.value * this.selectedBillingCycle.noOfMonths);
|
|
53
36
|
}
|
|
54
37
|
};
|
|
55
38
|
SubscribedPricingPlanModel.prototype.getBillingDiscount = function () {
|
|
@@ -58,6 +41,41 @@ var SubscribedPricingPlanModel = /** @class */ (function (_super) {
|
|
|
58
41
|
}
|
|
59
42
|
return 0;
|
|
60
43
|
};
|
|
44
|
+
SubscribedPricingPlanModel.prototype.validateGrossAmount = function (grossAmount, config) {
|
|
45
|
+
var calculatedGrossAmount = this.getGrossAmount(config);
|
|
46
|
+
if (Math.abs(calculatedGrossAmount - grossAmount) > 1) {
|
|
47
|
+
throw new _model_1.AppBadRequestException({
|
|
48
|
+
key: "grossAmount",
|
|
49
|
+
message: [
|
|
50
|
+
"calculated gross amount:'".concat(calculatedGrossAmount, "' is not matches with grossAmount you entered"),
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return calculatedGrossAmount;
|
|
55
|
+
};
|
|
56
|
+
SubscribedPricingPlanModel.prototype.validateNetAmount = function (netAmount, config) {
|
|
57
|
+
var calculatedNetAmount = this.getNetAmount(config);
|
|
58
|
+
if (calculatedNetAmount !== netAmount) {
|
|
59
|
+
throw new _model_1.AppBadRequestException({
|
|
60
|
+
key: "netAmount",
|
|
61
|
+
message: [
|
|
62
|
+
"calculated net amount:'".concat(calculatedNetAmount, "' is not matches with netAmount ").concat(netAmount, " you entered"),
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return calculatedNetAmount;
|
|
67
|
+
};
|
|
68
|
+
SubscribedPricingPlanModel.prototype.validateGetBillingCycleDiscount = function (discount) {
|
|
69
|
+
if (Number(discount.replace("P", "")) !== this.getBillingDiscount()) {
|
|
70
|
+
throw new _model_1.AppBadRequestException({
|
|
71
|
+
key: "discount",
|
|
72
|
+
message: [
|
|
73
|
+
"calculated discount:'".concat(this.getBillingDiscount(), "' is not matches with discount you entered"),
|
|
74
|
+
],
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return this.getBillingDiscount();
|
|
78
|
+
};
|
|
61
79
|
return SubscribedPricingPlanModel;
|
|
62
|
-
}(
|
|
80
|
+
}());
|
|
63
81
|
exports.SubscribedPricingPlanModel = SubscribedPricingPlanModel;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SubscriptionStatus } from "../@enum";
|
|
2
|
+
import { ICreateSubscriptionRequest, ISubscriptionEntity, IUserEntity } from "../@type";
|
|
3
|
+
export declare class SubscriptionEntityModel implements ISubscriptionEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
fromDateCode: number;
|
|
6
|
+
toDateCode: number;
|
|
7
|
+
organizationId: number;
|
|
8
|
+
type: string;
|
|
9
|
+
grossAmount: number;
|
|
10
|
+
discount: string;
|
|
11
|
+
netAmount: number;
|
|
12
|
+
amountPaid: number;
|
|
13
|
+
status: SubscriptionStatus;
|
|
14
|
+
remarks: string;
|
|
15
|
+
registrationId: number;
|
|
16
|
+
pricingPlanId: number;
|
|
17
|
+
createdOn: Date;
|
|
18
|
+
updatedOn: Date;
|
|
19
|
+
createdBy: number;
|
|
20
|
+
updatedBy: number;
|
|
21
|
+
constructor(subscriptionEntity: ISubscriptionEntity);
|
|
22
|
+
static getEntityInstanceByICreateSubscriptionRequestUserEntity(body: ICreateSubscriptionRequest, userEntity: IUserEntity, status: SubscriptionStatus, pricingPlanId: number): ISubscriptionEntity;
|
|
23
|
+
validateAdvanceAmount(isAmountPaidValidation?: boolean): void;
|
|
24
|
+
static filterByOrganizationId(subScriptionEntities: ISubscriptionEntity[], organizationId: number): ISubscriptionEntity[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionEntityModel = void 0;
|
|
4
|
+
var _model_1 = require("../@model");
|
|
5
|
+
var SubscriptionEntityModel = /** @class */ (function () {
|
|
6
|
+
function SubscriptionEntityModel(subscriptionEntity) {
|
|
7
|
+
Object.assign(this, subscriptionEntity);
|
|
8
|
+
}
|
|
9
|
+
SubscriptionEntityModel.getEntityInstanceByICreateSubscriptionRequestUserEntity = function (body, userEntity, status, pricingPlanId) {
|
|
10
|
+
var _a;
|
|
11
|
+
var subscriptionEntity = {};
|
|
12
|
+
subscriptionEntity.organizationId = userEntity.organizationId;
|
|
13
|
+
subscriptionEntity.fromDateCode = body.from;
|
|
14
|
+
subscriptionEntity.toDateCode = body.to;
|
|
15
|
+
subscriptionEntity.type = body.type;
|
|
16
|
+
subscriptionEntity.grossAmount = body.grossAmount;
|
|
17
|
+
subscriptionEntity.discount = body.discount;
|
|
18
|
+
subscriptionEntity.netAmount = body.netAmount;
|
|
19
|
+
subscriptionEntity.amountPaid = body.amountPaid;
|
|
20
|
+
subscriptionEntity.status = status;
|
|
21
|
+
subscriptionEntity.remarks = (_a = body.remarks) !== null && _a !== void 0 ? _a : "";
|
|
22
|
+
subscriptionEntity.createdBy = userEntity.id;
|
|
23
|
+
subscriptionEntity.createdOn = new Date();
|
|
24
|
+
subscriptionEntity.updatedBy = userEntity.id;
|
|
25
|
+
subscriptionEntity.updatedOn = new Date();
|
|
26
|
+
subscriptionEntity.pricingPlanId = pricingPlanId;
|
|
27
|
+
subscriptionEntity.registrationId = userEntity.registrationId;
|
|
28
|
+
return subscriptionEntity;
|
|
29
|
+
};
|
|
30
|
+
SubscriptionEntityModel.prototype.validateAdvanceAmount = function (isAmountPaidValidation) {
|
|
31
|
+
if (isAmountPaidValidation === void 0) { isAmountPaidValidation = false; }
|
|
32
|
+
if (this.amountPaid > this.netAmount) {
|
|
33
|
+
if (isAmountPaidValidation) {
|
|
34
|
+
throw new _model_1.AppBadRequestException({
|
|
35
|
+
key: "amountPaid",
|
|
36
|
+
message: [
|
|
37
|
+
"amount paid ".concat(this.amountPaid, " is not equal to net amount ").concat(this.netAmount),
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
throw new _model_1.AppBadRequestException({
|
|
43
|
+
key: "advanceAmount",
|
|
44
|
+
message: [
|
|
45
|
+
"advance should not greater than net amount:'".concat(this.netAmount, "'"),
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
SubscriptionEntityModel.filterByOrganizationId = function (subScriptionEntities, organizationId) {
|
|
52
|
+
return subScriptionEntities.filter(function (subScriptionEntity) {
|
|
53
|
+
return subScriptionEntity.organizationId === organizationId;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return SubscriptionEntityModel;
|
|
57
|
+
}());
|
|
58
|
+
exports.SubscriptionEntityModel = SubscriptionEntityModel;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UserStatus, UserType } from "../@enum";
|
|
2
|
+
import { IRegistrationEntity, IUserEntity } from "../@type";
|
|
3
|
+
export declare class UserEntityModel implements IUserEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
firstname: string;
|
|
6
|
+
phone: string;
|
|
7
|
+
password: string;
|
|
8
|
+
email: string;
|
|
9
|
+
status: UserStatus;
|
|
10
|
+
isEmailVerified: boolean;
|
|
11
|
+
isMobileVerified: boolean;
|
|
12
|
+
isAccountVerified: boolean;
|
|
13
|
+
requireNewPassword: boolean;
|
|
14
|
+
type: UserType;
|
|
15
|
+
registrationId: number;
|
|
16
|
+
organizationId: number;
|
|
17
|
+
imageUrl: string | null;
|
|
18
|
+
createdOn: Date;
|
|
19
|
+
updatedOn: Date;
|
|
20
|
+
createdBy: number;
|
|
21
|
+
updatedBy: number;
|
|
22
|
+
documentUrls: string | null;
|
|
23
|
+
constructor(userEntity: IUserEntity);
|
|
24
|
+
static getEntityInstanceByRegistrationEntityOrganizationId(registrationEntity: IRegistrationEntity, hashPassword: string, organizationId: number): IUserEntity;
|
|
25
|
+
static filterByOrganizationId(userEntities: IUserEntity[], organizationId: number): IUserEntity[];
|
|
26
|
+
}
|