turf-common 1.0.16 → 1.0.17
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/README.md +9 -0
- package/build/@enum.d.ts +17 -0
- package/build/@enum.js +33 -0
- package/build/@model.d.ts +8 -0
- package/build/@model.js +24 -0
- package/build/@type.d.ts +26 -0
- package/build/@type.js +42 -0
- package/build/enums/booking-details-status.enum.d.ts +4 -0
- package/build/enums/booking-details-status.enum.js +8 -0
- package/build/enums/booking-history-operation-type.enum.d.ts +10 -0
- package/build/enums/booking-history-operation-type.enum.js +18 -0
- package/build/enums/configuration-key.enum.d.ts +8 -0
- package/build/enums/configuration-key.enum.js +25 -0
- package/build/enums/cron-jobs-name.enum.d.ts +3 -0
- package/build/enums/cron-jobs-name.enum.js +7 -0
- package/build/enums/cron-jobs-status.enum.d.ts +5 -0
- package/build/enums/cron-jobs-status.enum.js +9 -0
- package/build/enums/faqs-status.enum.d.ts +3 -0
- package/build/enums/faqs-status.enum.js +7 -0
- package/build/enums/organization-status.enum.d.ts +15 -0
- package/build/enums/organization-status.enum.js +31 -0
- package/build/enums/payment-mode.enum.d.ts +4 -0
- package/build/enums/payment-mode.enum.js +8 -0
- package/build/enums/pitch-status.enum.d.ts +12 -0
- package/build/enums/pitch-status.enum.js +13 -0
- package/build/enums/pricing-plan-status.enum.d.ts +4 -0
- package/build/enums/pricing-plan-status.enum.js +8 -0
- package/build/enums/registration-status-enum.d.ts +12 -0
- package/build/enums/registration-status-enum.js +16 -0
- package/build/enums/subscription-status.enum.d.ts +23 -0
- package/build/enums/subscription-status.enum.js +40 -0
- package/build/enums/transaction-type.enum.d.ts +7 -0
- package/build/enums/transaction-type.enum.js +11 -0
- package/build/enums/user-status.enum.d.ts +11 -0
- package/build/enums/user-status.enum.js +15 -0
- package/build/enums/valid-type.enum.d.ts +6 -0
- package/build/enums/valid-type.enum.js +10 -0
- package/build/index.d.ts +0 -7
- package/build/index.js +0 -7
- package/build/interface/api/activate-subscription.interface.d.ts +3 -0
- package/build/interface/api/booking-availablity-by-pitch.interface.d.ts +28 -0
- package/build/interface/api/booking-availablity-by-pitch.interface.js +2 -0
- package/build/interface/api/cancellation-charges.interface.d.ts +6 -0
- package/build/interface/api/cancellation-charges.interface.js +2 -0
- package/build/interface/api/create-bank-details.interface.d.ts +3 -0
- package/build/interface/api/create-bank-details.interface.js +2 -0
- package/build/interface/api/create-cancellation-policy.interface.d.ts +3 -0
- package/build/interface/api/create-cancellation-policy.interface.js +2 -0
- package/build/interface/api/create-coupon.interface.d.ts +3 -0
- package/build/interface/api/create-coupon.interface.js +2 -0
- package/build/interface/api/create-faqs.interface.d.ts +3 -0
- package/build/interface/api/create-faqs.interface.js +2 -0
- package/build/interface/api/create-organization.interface.d.ts +3 -0
- package/build/interface/api/create-organization.interface.js +2 -0
- package/build/interface/api/create-pricing-plan.interface.d.ts +3 -0
- package/build/interface/api/create-pricing-plan.interface.js +2 -0
- package/build/interface/api/create-recurring-slot-booking.interface.d.ts +3 -0
- package/build/interface/api/create-recurring-slot-booking.interface.js +2 -0
- package/build/interface/api/create-registration-transaction-output.interface.d.ts +2 -0
- package/build/interface/api/create-registration-transaction-output.interface.js +2 -0
- package/build/interface/api/create-subscription.interface.d.ts +3 -0
- package/build/interface/api/create-subscription.interface.js +2 -0
- package/build/interface/api/delete-bank-details-by-id.interface.d.ts +3 -0
- package/build/interface/api/delete-bank-details-by-id.interface.js +2 -0
- package/build/interface/api/delete-booking-by-codes-response.interface.d.ts +7 -0
- package/build/interface/api/delete-booking-by-codes-response.interface.js +2 -0
- package/build/interface/api/delete-booking-by-codes.interface.d.ts +7 -0
- package/build/interface/api/delete-booking-by-codes.interface.js +2 -0
- package/build/interface/api/delete-booking-info.interface.d.ts +3 -0
- package/build/interface/api/delete-booking-info.interface.js +2 -0
- package/build/interface/api/delete-pricing-plan.interface.d.ts +3 -0
- package/build/interface/api/delete-pricing-plan.interface.js +2 -0
- package/build/interface/api/get-all-booking-of-turf.interface.d.ts +16 -0
- package/build/interface/api/get-all-booking-of-turf.interface.js +2 -0
- package/build/interface/api/get-bank-detail-by-id.interface.d.ts +3 -0
- package/build/interface/api/get-bank-detail-by-id.interface.js +2 -0
- package/build/interface/api/get-bank-detail-entities.interface.d.ts +3 -0
- package/build/interface/api/get-bank-detail-entities.interface.js +2 -0
- package/build/interface/api/get-booking-by-organization-id.interface.d.ts +19 -0
- package/build/interface/api/get-booking-by-organization-id.interface.js +2 -0
- package/build/interface/api/get-booking-customers.interface.d.ts +3 -0
- package/build/interface/api/get-booking-customers.interface.js +2 -0
- package/build/interface/api/get-booking-details-by-id.interface.d.ts +3 -0
- package/build/interface/api/get-booking-details-by-id.interface.js +2 -0
- package/build/interface/api/get-booking-info.interface.d.ts +11 -0
- package/build/interface/api/get-booking-info.interface.js +2 -0
- package/build/interface/api/get-cancellation-policy-entity-by-org-id.interface.d.ts +9 -0
- package/build/interface/api/get-cancellation-policy-entity-by-org-id.interface.js +2 -0
- package/build/interface/api/get-collection.interface.d.ts +12 -0
- package/build/interface/api/get-collection.interface.js +2 -0
- package/build/interface/api/get-cron-job-by-date-range-name-status.interface.d.ts +3 -0
- package/build/interface/api/get-cron-job-by-date-range-name-status.interface.js +2 -0
- package/build/interface/api/get-current-subscription.interface.d.ts +5 -0
- package/build/interface/api/get-current-subscription.interface.js +2 -0
- package/build/interface/api/get-organization-by-orgid.interface.d.ts +21 -0
- package/build/interface/api/get-organization-by-orgid.interface.js +2 -0
- package/build/interface/api/get-price-by-organization-response.interface.d.ts +6 -0
- package/build/interface/api/get-price-by-organization-response.interface.js +2 -0
- package/build/interface/api/get-price-entity.types.d.ts +5 -0
- package/build/interface/api/get-price-entity.types.js +2 -0
- package/build/interface/api/get-price-query.interface.d.ts +7 -0
- package/build/interface/api/get-price-query.interface.js +2 -0
- package/build/interface/api/get-pricing-plan-by-date-response.interface.d.ts +23 -0
- package/build/interface/api/get-pricing-plan-by-date-response.interface.js +2 -0
- package/build/interface/api/get-pricing-plan-by-id.interface.d.ts +3 -0
- package/build/interface/api/get-pricing-plan-by-id.interface.js +2 -0
- package/build/interface/api/get-pricing-plan-entities.interface.d.ts +3 -0
- package/build/interface/api/get-pricing-plan-entities.interface.js +2 -0
- package/build/interface/api/get-registration-by-id.types.d.ts +38 -0
- package/build/interface/api/get-registration-by-id.types.js +2 -0
- package/build/interface/api/get-registration-entities.interface.d.ts +36 -0
- package/build/interface/api/get-registration-entities.interface.js +2 -0
- package/build/interface/api/get-subscription-by-org-id.interface.d.ts +3 -0
- package/build/interface/api/get-subscription-by-org-id.interface.js +2 -0
- package/build/interface/api/get-subscription-entities.interface.d.ts +3 -0
- package/build/interface/api/get-subscription-entities.interface.js +2 -0
- package/build/interface/api/get-turf-by-organization.interface.d.ts +3 -0
- package/build/interface/api/get-turf-by-organization.interface.js +2 -0
- package/build/interface/api/get-turf-entity-response.interface.d.ts +3 -0
- package/build/interface/api/get-turf-entity-response.interface.js +2 -0
- package/build/interface/api/index.d.ts +64 -0
- package/build/interface/api/index.js +82 -0
- package/build/interface/api/list-of-coupons.interface.d.ts +8 -0
- package/build/interface/api/list-of-coupons.interface.js +2 -0
- package/build/interface/api/login-response.interface.d.ts +19 -0
- package/build/interface/api/login-response.interface.js +2 -0
- package/build/interface/api/one-slot-booking.interface.d.ts +3 -0
- package/build/interface/api/one-slot-booking.interface.js +2 -0
- package/build/interface/api/renew-subscription.interface.d.ts +3 -0
- package/build/interface/api/renew-subscription.interface.js +2 -0
- package/build/interface/api/setup-registration.interface.d.ts +5 -0
- package/build/interface/api/setup-registration.interface.js +2 -0
- package/build/interface/api/staff-member-list.interface.d.ts +10 -0
- package/build/interface/api/staff-member-list.interface.js +2 -0
- package/build/interface/api/update-bank-detail.interface.d.ts +3 -0
- package/build/interface/api/update-bank-detail.interface.js +2 -0
- package/build/interface/api/update-booking-by-code-response.d.ts +7 -0
- package/build/interface/api/update-booking-by-code-response.interface.d.ts +7 -0
- package/build/interface/api/update-booking-by-code-response.interface.js +2 -0
- package/build/interface/api/update-booking-by-code-response.js +2 -0
- package/build/interface/api/update-booking-by-code.interface.d.ts +15 -0
- package/build/interface/api/update-booking-by-code.interface.js +2 -0
- package/build/interface/api/update-configuration.interface.d.ts +3 -0
- package/build/interface/api/update-configuration.interface.js +2 -0
- package/build/interface/api/update-coupon.interface.d.ts +3 -0
- package/build/interface/api/update-coupon.interface.js +2 -0
- package/build/interface/api/update-faqs-steps.interface.d.ts +3 -0
- package/build/interface/api/update-faqs-steps.interface.js +2 -0
- package/build/interface/api/update-faqs.interface.d.ts +3 -0
- package/build/interface/api/update-faqs.interface.js +2 -0
- package/build/interface/api/update-organization.interface.d.ts +6 -0
- package/build/interface/api/update-organization.interface.js +2 -0
- package/build/interface/api/update-pricing-plan-by-id.interface.d.ts +7 -0
- package/build/interface/api/update-pricing-plan-by-id.interface.js +2 -0
- package/build/interface/api/update-recurring-booking.interface.d.ts +37 -0
- package/build/interface/api/update-recurring-booking.interface.js +2 -0
- package/build/interface/api/update-registration-entities.interface.d.ts +3 -0
- package/build/interface/api/update-registration-entities.interface.js +2 -0
- package/build/interface/api/update-staff-member.interface.d.ts +23 -0
- package/build/interface/api/update-staff-member.interface.js +2 -0
- package/build/interface/api/update-subscription.interface.d.ts +4 -0
- package/build/interface/api/update-subscription.interface.js +2 -0
- package/build/interface/api/update-turf-transaction-output.d.ts +3 -0
- package/build/interface/api/update-turf-transaction-output.js +2 -0
- package/build/interface/api/upgrade-renew-subscription.interface.d.ts +3 -0
- package/build/interface/api/upgrade-renew-subscription.interface.js +2 -0
- package/build/interface/api/upgrade-subscription.interface.d.ts +3 -0
- package/build/interface/api/upgrade-subscription.interface.js +2 -0
- package/build/interface/api/userentity-without-password.interface.d.ts +3 -0
- package/build/interface/api/userentity-without-password.interface.js +2 -0
- package/build/interface/billing-cycle-dto.interface.d.ts +8 -0
- package/build/interface/billing-cycle-dto.interface.js +2 -0
- package/build/interface/billing-cycle.interface.d.ts +7 -0
- package/build/interface/billing-cycle.interface.js +2 -0
- package/build/interface/booking-details-with-code.interface.d.ts +31 -0
- package/build/interface/booking-details-with-code.interface.js +2 -0
- package/build/interface/controller.interface.d.ts +6 -0
- package/build/interface/controller.interface.js +2 -0
- package/build/interface/dto/delete-booking-by-codes-dto.interface.d.ts +7 -0
- package/build/interface/dto/delete-booking-by-codes-dto.interface.js +2 -0
- package/build/interface/dto/update-booking-by-code-dto.interface.d.ts +15 -0
- package/build/interface/dto/update-booking-by-code-dto.interface.js +2 -0
- package/build/interface/entity/bank-details-entity.interface.d.ts +12 -0
- package/build/interface/entity/bank-details-entity.interface.js +2 -0
- package/build/interface/entity/booking-cancellation-entity.interface.d.ts +32 -0
- package/build/interface/entity/booking-cancellation-entity.interface.js +2 -0
- package/build/interface/entity/booking-customer-entity.interface.d.ts +8 -0
- package/build/interface/entity/booking-customer-entity.interface.js +2 -0
- package/build/interface/entity/booking-details-entity.interface.d.ts +27 -0
- package/build/interface/entity/booking-details-entity.interface.js +2 -0
- package/build/interface/entity/booking-history-entity.interface.d.ts +31 -0
- package/build/interface/entity/booking-history-entity.interface.js +2 -0
- package/build/interface/entity/booking-payment-history-entity.interface.d.ts +13 -0
- package/build/interface/entity/booking-payment-history-entity.interface.js +2 -0
- package/build/interface/entity/bookings-entity.interface.d.ts +6 -0
- package/build/interface/entity/bookings-entity.interface.js +2 -0
- package/build/interface/entity/cancellation-policy-entity.interface.d.ts +8 -0
- package/build/interface/entity/cancellation-policy-entity.interface.js +2 -0
- package/build/interface/entity/configurations-entity.interface.d.ts +8 -0
- package/build/interface/entity/configurations-entity.interface.js +2 -0
- package/build/interface/entity/coupon.entity.interface.d.ts +10 -0
- package/build/interface/entity/coupon.entity.interface.js +2 -0
- package/build/interface/entity/cron-jobs-entity.interface.d.ts +12 -0
- package/build/interface/entity/cron-jobs-entity.interface.js +2 -0
- package/build/interface/entity/entity-audit-column.interface.d.ts +12 -0
- package/build/interface/entity/entity-audit-column.interface.js +9 -0
- package/build/interface/entity/faqs-entity.interface.d.ts +10 -0
- package/build/interface/entity/faqs-entity.interface.js +2 -0
- package/build/interface/entity/index.d.ts +23 -0
- package/build/interface/entity/index.js +39 -0
- package/build/interface/entity/organization-entity.interface.d.ts +23 -0
- package/build/interface/entity/organization-entity.interface.js +2 -0
- package/build/interface/entity/pitch-entity.interface.d.ts +9 -0
- package/build/interface/entity/pitch-entity.interface.js +2 -0
- package/build/interface/entity/price-entity.interface.d.ts +5 -0
- package/build/interface/entity/price-entity.interface.js +2 -0
- package/build/interface/entity/pricing-plan-entity.interface.d.ts +16 -0
- package/build/interface/entity/pricing-plan-entity.interface.js +2 -0
- package/build/interface/entity/registration-entity.interface.d.ts +12 -0
- package/build/interface/entity/registration-entity.interface.js +2 -0
- package/build/interface/entity/subscription-entity.interface.d.ts +20 -0
- package/build/interface/entity/subscription-entity.interface.js +2 -0
- package/build/interface/entity/subscription-pitch-mapping.interface.d.ts +7 -0
- package/build/interface/entity/subscription-pitch-mapping.interface.js +3 -0
- package/build/interface/entity/turf-entity.interface.d.ts +17 -0
- package/build/interface/entity/turf-entity.interface.js +2 -0
- package/build/interface/entity/user-entity.interface.d.ts +25 -0
- package/build/interface/entity/user-entity.interface.js +2 -0
- package/build/interface/get-booking-by-id.interface.d.ts +56 -0
- package/build/interface/get-booking-by-id.interface.js +2 -0
- package/build/interface/get-pricing-plan-by-date-response.interface.d.ts +23 -0
- package/build/interface/get-pricing-plan-by-date-response.interface.js +2 -0
- package/build/interface/get-turf-entity.interface.d.ts +34 -0
- package/build/interface/get-turf-entity.interface.js +2 -0
- package/build/interface/model/booking-details-model.interface.d.ts +5 -0
- package/build/interface/model/booking-details-model.interface.js +2 -0
- package/build/interface/model/booking-entity-model.interface.d.ts +8 -0
- package/build/interface/model/booking-entity-model.interface.js +2 -0
- package/build/interface/model/cancellation-policy-model.interface.d.ts +4 -0
- package/build/interface/model/cancellation-policy-model.interface.js +2 -0
- package/build/interface/model/charge-model.interface.js +2 -0
- package/build/interface/model/configuration-model.interface.d.ts +4 -0
- package/build/interface/model/configuration-model.interface.js +2 -0
- package/build/interface/model/index.d.ts +10 -0
- package/build/interface/model/index.js +26 -0
- package/build/interface/model/price-model.interface.d.ts +3 -0
- package/build/interface/model/price-model.interface.js +2 -0
- package/build/interface/model/pricing-plan-entity-model.interface.d.ts +13 -0
- package/build/interface/model/pricing-plan-entity-model.interface.js +2 -0
- package/build/interface/model/pricing-plan-model.interface.d.ts +15 -0
- package/build/interface/model/pricing-plan-model.interface.js +2 -0
- package/build/interface/model/turf-model.interface.d.ts +7 -0
- package/build/interface/model/turf-model.interface.js +2 -0
- package/build/interface/model/user-model.interface.d.ts +3 -0
- package/build/interface/model/user-model.interface.js +2 -0
- package/build/interface/pitch-slab-dto.interface.d.ts +8 -0
- package/build/interface/pitch-slab-dto.interface.js +2 -0
- package/build/interface/pitch-slab.interface.d.ts +5 -0
- package/build/interface/pitch-slab.interface.js +2 -0
- package/build/interface/pricing-plan.interface.d.ts +15 -0
- package/build/interface/pricing-plan.interface.js +2 -0
- package/build/interface/upload-multer-file.interface.d.ts +9 -0
- package/build/interface/upload-multer-file.interface.js +2 -0
- package/build/interface/user-info-dto.interface.d.ts +16 -0
- package/build/interface/user-info-dto.interface.js +2 -0
- package/build/interface/without-token-registration-entity.types.d.ts +3 -0
- package/build/interface/without-token-registration-entity.types.js +2 -0
- package/build/models/billing-cycle-model.d.ts +10 -0
- package/build/models/billing-cycle-model.js +20 -0
- package/build/models/charge-model.d.ts +1 -1
- package/build/models/entity/booking-details-model.d.ts +39 -0
- package/build/models/entity/booking-details-model.js +69 -0
- package/build/models/entity/booking-entity-model.d.ts +21 -0
- package/build/models/entity/booking-entity-model.js +47 -0
- package/build/models/entity/booking-payment-history-model.d.ts +20 -0
- package/build/models/entity/booking-payment-history-model.js +36 -0
- package/build/models/entity/cancellation-policy-model.d.ts +18 -0
- package/build/models/entity/cancellation-policy-model.js +32 -0
- package/build/models/entity/configuration-model.d.ts +16 -0
- package/build/models/entity/configuration-model.js +17 -0
- package/build/models/entity/index.d.ts +10 -0
- package/build/models/entity/index.js +26 -0
- package/build/models/entity/price-model.d.ts +11 -0
- package/build/models/entity/price-model.js +15 -0
- package/build/models/entity/pricing-plan-entity-model.d.ts +47 -0
- package/build/models/entity/pricing-plan-entity-model.js +128 -0
- package/build/models/entity/subscription-model.d.ts +30 -0
- package/build/models/entity/subscription-model.js +51 -0
- package/build/models/entity/turf-model.d.ts +34 -0
- package/build/models/entity/turf-model.js +88 -0
- package/build/models/entity/user-model.d.ts +32 -0
- package/build/models/entity/user-model.js +19 -0
- package/build/models/pitch-slab-model.d.ts +9 -0
- package/build/models/pitch-slab-model.js +21 -0
- package/build/models/pricing-plan-model.d.ts +24 -0
- package/build/models/pricing-plan-model.js +67 -0
- package/build/models/subscribed-pricing-plan-model.d.ts +26 -0
- package/build/models/subscribed-pricing-plan-model.js +88 -0
- package/build/types/bookingdetails-with-booking.type.d.ts +34 -0
- package/build/types/bookingdetails-with-booking.type.js +2 -0
- package/build/types/date-wise-payment-history-data.types.d.ts +9 -0
- package/build/types/date-wise-payment-history-data.types.js +2 -0
- package/package.json +33 -27
- /package/build/interface/{charge-model.interface.js → api/activate-subscription.interface.js} +0 -0
- /package/build/interface/{charge-model.interface.d.ts → model/charge-model.interface.d.ts} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./booking-details-model"), exports);
|
|
18
|
+
__exportStar(require("./booking-entity-model"), exports);
|
|
19
|
+
__exportStar(require("./booking-payment-history-model"), exports);
|
|
20
|
+
__exportStar(require("./cancellation-policy-model"), exports);
|
|
21
|
+
__exportStar(require("./configuration-model"), exports);
|
|
22
|
+
__exportStar(require("./price-model"), exports);
|
|
23
|
+
__exportStar(require("./pricing-plan-entity-model"), exports);
|
|
24
|
+
__exportStar(require("./subscription-model"), exports);
|
|
25
|
+
__exportStar(require("./turf-model"), exports);
|
|
26
|
+
__exportStar(require("./user-model"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPriceModel } from "../../interface/model";
|
|
2
|
+
import { IPriceEntity } from "../../interface/entity/price-entity.interface";
|
|
3
|
+
export declare class PriceModel implements IPriceModel {
|
|
4
|
+
id: string;
|
|
5
|
+
price: number;
|
|
6
|
+
createdOn: Date;
|
|
7
|
+
updatedOn: Date;
|
|
8
|
+
createdBy: number;
|
|
9
|
+
updatedBy: number;
|
|
10
|
+
static sortByCode(priceEntities: IPriceEntity[]): IPriceEntity[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PriceModel = void 0;
|
|
4
|
+
var PriceModel = /** @class */ (function () {
|
|
5
|
+
function PriceModel() {
|
|
6
|
+
}
|
|
7
|
+
PriceModel.sortByCode = function (priceEntities) {
|
|
8
|
+
priceEntities = priceEntities.sort(function (a, b) {
|
|
9
|
+
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
10
|
+
});
|
|
11
|
+
return priceEntities;
|
|
12
|
+
};
|
|
13
|
+
return PriceModel;
|
|
14
|
+
}());
|
|
15
|
+
exports.PriceModel = PriceModel;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PricingPlanStatus } from "../../enums/pricing-plan-status.enum";
|
|
2
|
+
import { IBillingCycleModel } from "../../interface/billing-cycle.interface";
|
|
3
|
+
import { GetPricingPlanByDateResponse } from "../../interface/get-pricing-plan-by-date-response.interface";
|
|
4
|
+
import { IPitchSlab } from "../../interface/pitch-slab.interface";
|
|
5
|
+
import { IPricingPlanEntityModel } from "../../interface/model/pricing-plan-entity-model.interface";
|
|
6
|
+
import { IPricingPlanEntity } from "../../interface/entity/pricing-plan-entity.interface";
|
|
7
|
+
import { BillingCycleModel } from "../billing-cycle-model";
|
|
8
|
+
import { PricingPlanModel } from "../pricing-plan-model";
|
|
9
|
+
export declare class PricingPlanEntityModel implements IPricingPlanEntityModel {
|
|
10
|
+
id: number;
|
|
11
|
+
effectiveFrom: Date;
|
|
12
|
+
effectiveTo: Date;
|
|
13
|
+
costCode: string;
|
|
14
|
+
status: PricingPlanStatus;
|
|
15
|
+
createdBy: number;
|
|
16
|
+
createdOn: Date;
|
|
17
|
+
updatedBy: number;
|
|
18
|
+
updatedOn: Date;
|
|
19
|
+
basePrice: number;
|
|
20
|
+
billingCycle: string;
|
|
21
|
+
unit: string;
|
|
22
|
+
constructor(data: IPricingPlanEntity);
|
|
23
|
+
getBillingCycleKeys(): string[];
|
|
24
|
+
toModel(): PricingPlanModel;
|
|
25
|
+
arrayToIndexedObject<T>(arr: T[]): {
|
|
26
|
+
[key: string]: T;
|
|
27
|
+
};
|
|
28
|
+
toObject(): GetPricingPlanByDateResponse;
|
|
29
|
+
toPitchSlabs(): IPitchSlab[];
|
|
30
|
+
toBillingCycles(): IBillingCycleModel[];
|
|
31
|
+
}
|
|
32
|
+
export declare class PitchSlabParser {
|
|
33
|
+
code: string;
|
|
34
|
+
constructor(code: string);
|
|
35
|
+
parseToModel(): IPitchSlab;
|
|
36
|
+
}
|
|
37
|
+
export declare class BillingCycleCodeParser {
|
|
38
|
+
code: string;
|
|
39
|
+
from: number;
|
|
40
|
+
to: number;
|
|
41
|
+
discount: string;
|
|
42
|
+
name: string;
|
|
43
|
+
constructor(code: string);
|
|
44
|
+
parse(): BillingCycleCodeParser;
|
|
45
|
+
parseToModel(): BillingCycleModel;
|
|
46
|
+
getKey(): string;
|
|
47
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingCycleCodeParser = exports.PitchSlabParser = exports.PricingPlanEntityModel = void 0;
|
|
4
|
+
var billing_cycle_model_1 = require("../billing-cycle-model");
|
|
5
|
+
var booking_code_model_1 = require("../booking-code-model");
|
|
6
|
+
var pitch_slab_model_1 = require("../pitch-slab-model");
|
|
7
|
+
var pricing_plan_model_1 = require("../pricing-plan-model");
|
|
8
|
+
var PricingPlanEntityModel = /** @class */ (function () {
|
|
9
|
+
function PricingPlanEntityModel(data) {
|
|
10
|
+
Object.assign(this, data);
|
|
11
|
+
}
|
|
12
|
+
PricingPlanEntityModel.prototype.getBillingCycleKeys = function () {
|
|
13
|
+
return this.toBillingCycles().map(function (billingCycle) { return billingCycle.key; });
|
|
14
|
+
};
|
|
15
|
+
PricingPlanEntityModel.prototype.toModel = function () {
|
|
16
|
+
return new pricing_plan_model_1.PricingPlanModel({
|
|
17
|
+
id: this.id,
|
|
18
|
+
base_price: this.basePrice,
|
|
19
|
+
effective_from_date: parseInt(booking_code_model_1.BookingCode.getDateCode(this.effectiveFrom)),
|
|
20
|
+
effective_to_date: parseInt(booking_code_model_1.BookingCode.getDateCode(this.effectiveTo)),
|
|
21
|
+
unit: this.unit,
|
|
22
|
+
billing_cycle: this.arrayToIndexedObject(this.toBillingCycles()),
|
|
23
|
+
pitch_slab: this.arrayToIndexedObject(this.toPitchSlabs()),
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
PricingPlanEntityModel.prototype.arrayToIndexedObject = function (arr) {
|
|
27
|
+
return arr.reduce(function (result, item, index) {
|
|
28
|
+
result[index.toString()] = item; //a, b, c
|
|
29
|
+
return result;
|
|
30
|
+
}, {});
|
|
31
|
+
};
|
|
32
|
+
PricingPlanEntityModel.prototype.toObject = function () {
|
|
33
|
+
var responseObj = {
|
|
34
|
+
id: this.id,
|
|
35
|
+
effective_from_date: 0,
|
|
36
|
+
effective_to_date: 0,
|
|
37
|
+
base_price: 0,
|
|
38
|
+
unit: "per_hour_per_pitch",
|
|
39
|
+
pitch_slab: {},
|
|
40
|
+
billing_cycle: {},
|
|
41
|
+
};
|
|
42
|
+
var billingCycle = this.billingCycle.split(",");
|
|
43
|
+
billingCycle.forEach(function (billing, index) {
|
|
44
|
+
var billingArray = billing.split("_");
|
|
45
|
+
responseObj.billing_cycle[index] = {
|
|
46
|
+
from: Number(billingArray[0].slice(0, 3)),
|
|
47
|
+
to: Number(billingArray[0].slice(3, 6)),
|
|
48
|
+
discount: billingArray[1],
|
|
49
|
+
name: billingArray.slice(2).join("_"),
|
|
50
|
+
key: billingArray.slice(2).join("-").toLowerCase().replace(/ /g, "-"),
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
this.costCode.split(",").forEach(function (code, index) {
|
|
54
|
+
var costCode = code.split("_");
|
|
55
|
+
responseObj.pitch_slab[index] = {
|
|
56
|
+
from: Number(costCode[0].slice(0, 3)),
|
|
57
|
+
to: Number(costCode[0].slice(3, 6)),
|
|
58
|
+
discount: costCode[1],
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
responseObj.effective_from_date = Number(booking_code_model_1.BookingCode.getDateCode(this.effectiveFrom));
|
|
62
|
+
responseObj.effective_to_date = Number(booking_code_model_1.BookingCode.getDateCode(this.effectiveTo));
|
|
63
|
+
responseObj.unit = this.unit;
|
|
64
|
+
responseObj.base_price = this.basePrice;
|
|
65
|
+
return responseObj;
|
|
66
|
+
};
|
|
67
|
+
PricingPlanEntityModel.prototype.toPitchSlabs = function () {
|
|
68
|
+
return this.costCode
|
|
69
|
+
.split(",")
|
|
70
|
+
.map(function (cost_code) { return new PitchSlabParser(cost_code).parseToModel(); });
|
|
71
|
+
};
|
|
72
|
+
PricingPlanEntityModel.prototype.toBillingCycles = function () {
|
|
73
|
+
return this.billingCycle
|
|
74
|
+
.split(",")
|
|
75
|
+
.map(function (billingCode) {
|
|
76
|
+
return new BillingCycleCodeParser(billingCode).parseToModel();
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
return PricingPlanEntityModel;
|
|
80
|
+
}());
|
|
81
|
+
exports.PricingPlanEntityModel = PricingPlanEntityModel;
|
|
82
|
+
var PitchSlabParser = /** @class */ (function () {
|
|
83
|
+
function PitchSlabParser(code) {
|
|
84
|
+
this.code = code;
|
|
85
|
+
}
|
|
86
|
+
PitchSlabParser.prototype.parseToModel = function () {
|
|
87
|
+
var costCodeComponents = this.code.split("_");
|
|
88
|
+
return new pitch_slab_model_1.PitchSlabModel({
|
|
89
|
+
discount: costCodeComponents[1],
|
|
90
|
+
from: parseInt(costCodeComponents[0].slice(0, 3)),
|
|
91
|
+
to: parseInt(costCodeComponents[0].slice(3)),
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return PitchSlabParser;
|
|
95
|
+
}());
|
|
96
|
+
exports.PitchSlabParser = PitchSlabParser;
|
|
97
|
+
var BillingCycleCodeParser = /** @class */ (function () {
|
|
98
|
+
function BillingCycleCodeParser(code) {
|
|
99
|
+
this.code = code;
|
|
100
|
+
}
|
|
101
|
+
BillingCycleCodeParser.prototype.parse = function () {
|
|
102
|
+
var billingCycleComponents = this.code.split("_");
|
|
103
|
+
this.from = parseInt(billingCycleComponents[0].slice(0, 3));
|
|
104
|
+
this.to = parseInt(billingCycleComponents[0].slice(3, 6));
|
|
105
|
+
this.discount = billingCycleComponents[1];
|
|
106
|
+
this.name = billingCycleComponents[2];
|
|
107
|
+
return this;
|
|
108
|
+
};
|
|
109
|
+
BillingCycleCodeParser.prototype.parseToModel = function () {
|
|
110
|
+
var billingCycleComponents = this.code.split("_");
|
|
111
|
+
this.from = parseInt(billingCycleComponents[0].slice(0, 3));
|
|
112
|
+
this.to = parseInt(billingCycleComponents[0].slice(3, 6));
|
|
113
|
+
this.discount = billingCycleComponents[1];
|
|
114
|
+
this.name = billingCycleComponents[2];
|
|
115
|
+
return new billing_cycle_model_1.BillingCycleModel({
|
|
116
|
+
discount: this.discount,
|
|
117
|
+
from: this.from,
|
|
118
|
+
to: this.to,
|
|
119
|
+
name: this.name,
|
|
120
|
+
key: this.getKey(),
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
BillingCycleCodeParser.prototype.getKey = function () {
|
|
124
|
+
return this.name.toLowerCase().replace(" ", "-");
|
|
125
|
+
};
|
|
126
|
+
return BillingCycleCodeParser;
|
|
127
|
+
}());
|
|
128
|
+
exports.BillingCycleCodeParser = BillingCycleCodeParser;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SubscriptionStatus } from "../../enums/subscription-status.enum";
|
|
2
|
+
import { ISubscriptionEntity, ISubscriptionModel } from "../../interface/entity/subscription-entity.interface";
|
|
3
|
+
export declare class SubscriptionModel implements ISubscriptionModel {
|
|
4
|
+
id: number;
|
|
5
|
+
organizationId: number;
|
|
6
|
+
from: Date;
|
|
7
|
+
to: Date;
|
|
8
|
+
type: string;
|
|
9
|
+
grossAmount: number;
|
|
10
|
+
discount: string;
|
|
11
|
+
netAmount: number;
|
|
12
|
+
amountPaid: number;
|
|
13
|
+
status: SubscriptionStatus;
|
|
14
|
+
noOfPitches: number;
|
|
15
|
+
remarks: string;
|
|
16
|
+
registrationId: number;
|
|
17
|
+
pricingPlanId: number;
|
|
18
|
+
previousSubscriptionIds: string;
|
|
19
|
+
createdOn: Date;
|
|
20
|
+
updatedOn: Date;
|
|
21
|
+
createdBy: number;
|
|
22
|
+
updatedBy: number;
|
|
23
|
+
constructor(data: ISubscriptionEntity);
|
|
24
|
+
remainingSubscriptionDays(): number;
|
|
25
|
+
static updateStatus(subscriptionEntities: ISubscriptionEntity[], status: SubscriptionStatus, userId: number): ISubscriptionEntity[];
|
|
26
|
+
remainingAmount(): number;
|
|
27
|
+
isAmountFullyPaid(): boolean;
|
|
28
|
+
isAmountPaidGreater(): boolean;
|
|
29
|
+
updateStatusIfPaymentDone(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionModel = void 0;
|
|
4
|
+
var subscription_status_enum_1 = require("../../enums/subscription-status.enum");
|
|
5
|
+
var SubscriptionModel = /** @class */ (function () {
|
|
6
|
+
function SubscriptionModel(data) {
|
|
7
|
+
Object.assign(this, data);
|
|
8
|
+
}
|
|
9
|
+
SubscriptionModel.prototype.remainingSubscriptionDays = function () {
|
|
10
|
+
var oneDay = 24 * 60 * 60 * 1000;
|
|
11
|
+
var dayDifference = Math.ceil((this.to.getTime() - new Date().getTime()) / oneDay);
|
|
12
|
+
return dayDifference - 1; //minus 1 day
|
|
13
|
+
};
|
|
14
|
+
SubscriptionModel.updateStatus = function (subscriptionEntities, status, userId) {
|
|
15
|
+
return subscriptionEntities.map(function (subscriptionEntity) {
|
|
16
|
+
subscriptionEntity.status = status;
|
|
17
|
+
subscriptionEntity.updatedBy = userId;
|
|
18
|
+
subscriptionEntity.updatedOn = new Date();
|
|
19
|
+
return subscriptionEntity;
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
SubscriptionModel.prototype.remainingAmount = function () {
|
|
23
|
+
return this.netAmount - this.amountPaid;
|
|
24
|
+
};
|
|
25
|
+
SubscriptionModel.prototype.isAmountFullyPaid = function () {
|
|
26
|
+
if (this.netAmount === this.amountPaid) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
31
|
+
SubscriptionModel.prototype.isAmountPaidGreater = function () {
|
|
32
|
+
if (this.amountPaid > this.netAmount) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
37
|
+
SubscriptionModel.prototype.updateStatusIfPaymentDone = function () {
|
|
38
|
+
if (this.isAmountFullyPaid()) {
|
|
39
|
+
this.status =
|
|
40
|
+
this.status === subscription_status_enum_1.SubscriptionStatus.UPGRADE_PAYMENT_PENDING
|
|
41
|
+
? subscription_status_enum_1.SubscriptionStatus.UPGRADE_PAYMENT_DONE
|
|
42
|
+
: this.status === subscription_status_enum_1.SubscriptionStatus.UPGRADE_RENEW_PAYMENT_PENDING
|
|
43
|
+
? subscription_status_enum_1.SubscriptionStatus.UPGRADE_RENEW_PAYMENT_DONE
|
|
44
|
+
: this.status === subscription_status_enum_1.SubscriptionStatus.PAYMENT_PENDING
|
|
45
|
+
? subscription_status_enum_1.SubscriptionStatus.PAYMENT_DONE
|
|
46
|
+
: this.status;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return SubscriptionModel;
|
|
50
|
+
}());
|
|
51
|
+
exports.SubscriptionModel = SubscriptionModel;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IPitchStatus } from "../../enums/pitch-status.enum";
|
|
2
|
+
import { ITurf } from "../../interface/get-turf-entity.interface";
|
|
3
|
+
import { ITurfModel } from "../../interface/model/turf-model.interface";
|
|
4
|
+
import { IOrganizationEntity } from "../../interface/entity/organization-entity.interface";
|
|
5
|
+
import { IPitchEntity } from "../../interface/entity/pitch-entity.interface";
|
|
6
|
+
import { ISubscriptionPitchMappingEntity } from "../../interface/entity/subscription-pitch-mapping.interface";
|
|
7
|
+
import { ITurfEntity } from "../../interface/entity/turf-entity.interface";
|
|
8
|
+
import { IUserEntity } from "../../interface/entity/user-entity.interface";
|
|
9
|
+
export declare class TurfModel implements ITurfModel {
|
|
10
|
+
id: number;
|
|
11
|
+
turfName: string;
|
|
12
|
+
numberOfPitches: number;
|
|
13
|
+
address: string;
|
|
14
|
+
org_id: number;
|
|
15
|
+
adhocRefund: boolean;
|
|
16
|
+
createdOn: Date;
|
|
17
|
+
updatedOn: Date;
|
|
18
|
+
createdBy: number;
|
|
19
|
+
updatedBy: number;
|
|
20
|
+
pitches: IPitchEntity[];
|
|
21
|
+
organization: IOrganizationEntity;
|
|
22
|
+
Users: IUserEntity[];
|
|
23
|
+
constructor(data: ITurfEntity);
|
|
24
|
+
getPitchStatusCount(): IPitchStatus;
|
|
25
|
+
getModifiedTurfEntity(): ITurf;
|
|
26
|
+
static toMap(turfEntities: ITurfModel[]): {
|
|
27
|
+
[key: number]: ITurf;
|
|
28
|
+
};
|
|
29
|
+
static toKeyValue(turfEntities: ITurfEntity[]): {
|
|
30
|
+
[key: number]: ITurfEntity;
|
|
31
|
+
};
|
|
32
|
+
static fromEntity(data: ITurfEntity): ITurfModel;
|
|
33
|
+
static filterBySubscriptionPitchMapping(turfEntities: ITurfEntity[], subscriptionPitchMappingEntities: ISubscriptionPitchMappingEntity[], pitchStatusSet: Set<string>): ITurfEntity[];
|
|
34
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurfModel = void 0;
|
|
4
|
+
var pitch_status_enum_1 = require("../../enums/pitch-status.enum");
|
|
5
|
+
var TurfModel = /** @class */ (function () {
|
|
6
|
+
function TurfModel(data) {
|
|
7
|
+
Object.assign(this, data);
|
|
8
|
+
}
|
|
9
|
+
TurfModel.prototype.getPitchStatusCount = function () {
|
|
10
|
+
var statusCount = {};
|
|
11
|
+
for (var _i = 0, _a = Object.values(pitch_status_enum_1.PitchStatus); _i < _a.length; _i++) {
|
|
12
|
+
var status_1 = _a[_i];
|
|
13
|
+
statusCount[status_1] = 0;
|
|
14
|
+
}
|
|
15
|
+
for (var _b = 0, _c = this.pitches; _b < _c.length; _b++) {
|
|
16
|
+
var pitch = _c[_b];
|
|
17
|
+
statusCount[pitch.status] += 1;
|
|
18
|
+
}
|
|
19
|
+
return statusCount;
|
|
20
|
+
};
|
|
21
|
+
TurfModel.prototype.getModifiedTurfEntity = function () {
|
|
22
|
+
return {
|
|
23
|
+
id: this.id,
|
|
24
|
+
turfName: this.turfName,
|
|
25
|
+
numberOfPitches: this.numberOfPitches,
|
|
26
|
+
address: this.address,
|
|
27
|
+
org_id: this.org_id,
|
|
28
|
+
updatedBy: this.updatedBy,
|
|
29
|
+
updatedOn: this.updatedOn,
|
|
30
|
+
createdBy: this.createdBy,
|
|
31
|
+
createdOn: this.createdOn,
|
|
32
|
+
pitches: this.pitches.map(function (_a) {
|
|
33
|
+
var turf = _a.turf, number = _a.number, name = _a.name, status = _a.status, sports = _a.sports, createdBy = _a.createdBy, createdOn = _a.createdOn, updatedBy = _a.updatedBy, updatedOn = _a.updatedOn;
|
|
34
|
+
return ({
|
|
35
|
+
turf: turf.id,
|
|
36
|
+
number: number,
|
|
37
|
+
name: name,
|
|
38
|
+
status: status,
|
|
39
|
+
sports: sports.split(",").map(function (sport) { return ({ name: sport }); }),
|
|
40
|
+
createdBy: createdBy,
|
|
41
|
+
createdOn: createdOn,
|
|
42
|
+
updatedBy: updatedBy,
|
|
43
|
+
updatedOn: updatedOn,
|
|
44
|
+
});
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
TurfModel.toMap = function (turfEntities) {
|
|
49
|
+
var response = {};
|
|
50
|
+
turfEntities.forEach(function (turfEntity) {
|
|
51
|
+
if (!response[turfEntity.id]) {
|
|
52
|
+
response[turfEntity.id] = turfEntity.getModifiedTurfEntity();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return response;
|
|
56
|
+
};
|
|
57
|
+
TurfModel.toKeyValue = function (turfEntities) {
|
|
58
|
+
var response = {};
|
|
59
|
+
turfEntities.forEach(function (turfEntity) {
|
|
60
|
+
if (!response[turfEntity.id]) {
|
|
61
|
+
response[turfEntity.id] = turfEntity;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return response;
|
|
65
|
+
};
|
|
66
|
+
TurfModel.fromEntity = function (data) {
|
|
67
|
+
return new TurfModel(data);
|
|
68
|
+
};
|
|
69
|
+
TurfModel.filterBySubscriptionPitchMapping = function (turfEntities, subscriptionPitchMappingEntities, pitchStatusSet) {
|
|
70
|
+
turfEntities.forEach(function (turfEntity) {
|
|
71
|
+
turfEntity.pitches = turfEntity.pitches.filter(function (pitchEntity) {
|
|
72
|
+
var subscriptionPitchMappingEntity = subscriptionPitchMappingEntities.find(function (_a) {
|
|
73
|
+
var turfId = _a.turfId, pitchId = _a.pitchId, status = _a.status;
|
|
74
|
+
return turfId === turfEntity.id &&
|
|
75
|
+
pitchId === pitchEntity.number &&
|
|
76
|
+
pitchStatusSet.has(status);
|
|
77
|
+
});
|
|
78
|
+
if (subscriptionPitchMappingEntity)
|
|
79
|
+
return true;
|
|
80
|
+
else
|
|
81
|
+
false;
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return turfEntities;
|
|
85
|
+
};
|
|
86
|
+
return TurfModel;
|
|
87
|
+
}());
|
|
88
|
+
exports.TurfModel = TurfModel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { UserStatus } from "../../enums/user-status.enum";
|
|
2
|
+
import { UserType } from "../../enums/valid-type.enum";
|
|
3
|
+
import { IUserModel } from "../../interface/model/user-model.interface";
|
|
4
|
+
import { ITurfEntity } from "../../interface/entity/turf-entity.interface";
|
|
5
|
+
import { IUserEntity } from "../../interface/entity/user-entity.interface";
|
|
6
|
+
export declare class UserModel implements IUserModel {
|
|
7
|
+
id: number;
|
|
8
|
+
firstname: string;
|
|
9
|
+
lastname: string;
|
|
10
|
+
phone: string;
|
|
11
|
+
password: string;
|
|
12
|
+
email: string;
|
|
13
|
+
status: UserStatus;
|
|
14
|
+
is_email_verified: boolean;
|
|
15
|
+
is_mobile_verified: boolean;
|
|
16
|
+
is_account_verified: boolean;
|
|
17
|
+
require_new_password: boolean;
|
|
18
|
+
organization_id: number;
|
|
19
|
+
type: UserType;
|
|
20
|
+
createdOn: Date;
|
|
21
|
+
updatedOn: Date;
|
|
22
|
+
createdBy: number;
|
|
23
|
+
updatedBy: number;
|
|
24
|
+
registrationId: number;
|
|
25
|
+
comments: string;
|
|
26
|
+
turf: ITurfEntity[];
|
|
27
|
+
imageUrl: string;
|
|
28
|
+
constructor(data: IUserModel);
|
|
29
|
+
static toMap(userEntities: IUserEntity[]): {
|
|
30
|
+
[key: number]: IUserEntity;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserModel = void 0;
|
|
4
|
+
var UserModel = /** @class */ (function () {
|
|
5
|
+
function UserModel(data) {
|
|
6
|
+
Object.assign(this, data);
|
|
7
|
+
}
|
|
8
|
+
UserModel.toMap = function (userEntities) {
|
|
9
|
+
var response = {};
|
|
10
|
+
userEntities.forEach(function (userEntity) {
|
|
11
|
+
if (!response[userEntity.id]) {
|
|
12
|
+
response[userEntity.id] = userEntity;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return response;
|
|
16
|
+
};
|
|
17
|
+
return UserModel;
|
|
18
|
+
}());
|
|
19
|
+
exports.UserModel = UserModel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPitchSlab } from "../interface/pitch-slab.interface";
|
|
2
|
+
export declare class PitchSlabModel implements IPitchSlab {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
discount: string;
|
|
6
|
+
constructor(data: IPitchSlab);
|
|
7
|
+
getDiscount(): number;
|
|
8
|
+
getBasePrice(basePrice: number): number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PitchSlabModel = void 0;
|
|
4
|
+
var PitchSlabModel = /** @class */ (function () {
|
|
5
|
+
function PitchSlabModel(data) {
|
|
6
|
+
this.from = data.from;
|
|
7
|
+
this.to = data.to;
|
|
8
|
+
this.discount = data.discount;
|
|
9
|
+
}
|
|
10
|
+
PitchSlabModel.prototype.getDiscount = function () {
|
|
11
|
+
if (this.discount.indexOf("P") > -1) {
|
|
12
|
+
return parseFloat(this.discount.replace("P", ""));
|
|
13
|
+
}
|
|
14
|
+
return 0;
|
|
15
|
+
};
|
|
16
|
+
PitchSlabModel.prototype.getBasePrice = function (basePrice) {
|
|
17
|
+
return basePrice * (1 - this.getDiscount() / 100);
|
|
18
|
+
};
|
|
19
|
+
return PitchSlabModel;
|
|
20
|
+
}());
|
|
21
|
+
exports.PitchSlabModel = PitchSlabModel;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IPricingPlanModel } from "../interface/pricing-plan.interface";
|
|
2
|
+
import { PitchSlabModel } from "./pitch-slab-model";
|
|
3
|
+
import { BillingCycleModel } from "./billing-cycle-model";
|
|
4
|
+
export declare class PricingPlanModel implements IPricingPlanModel {
|
|
5
|
+
id: number;
|
|
6
|
+
effective_from_date: number;
|
|
7
|
+
effective_to_date: number;
|
|
8
|
+
base_price: number;
|
|
9
|
+
unit: string;
|
|
10
|
+
pitch_slab: {
|
|
11
|
+
[key: string]: PitchSlabModel;
|
|
12
|
+
};
|
|
13
|
+
billing_cycle: {
|
|
14
|
+
[key: string]: BillingCycleModel;
|
|
15
|
+
};
|
|
16
|
+
constructor(data: IPricingPlanModel);
|
|
17
|
+
getPitchSlab(pitchCount: number): PitchSlabModel;
|
|
18
|
+
getBillingCycle(billingCycleKey: string): BillingCycleModel;
|
|
19
|
+
getMonth(billingCycleKey: string): number;
|
|
20
|
+
getNoOfSubscriptionDays(billingCycleKey: string): number;
|
|
21
|
+
getBillingCycleKeys(): string[];
|
|
22
|
+
validateBillingCycleKey(billingCycleKey: string): void;
|
|
23
|
+
getBillingCycleByDay(numberOfDay: number): BillingCycleModel | undefined;
|
|
24
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PricingPlanModel = void 0;
|
|
4
|
+
var pitch_slab_model_1 = require("./pitch-slab-model");
|
|
5
|
+
var billing_cycle_model_1 = require("./billing-cycle-model");
|
|
6
|
+
var app_badrequest_exception_1 = require("../exceptions/app-badrequest.exception");
|
|
7
|
+
var PricingPlanModel = /** @class */ (function () {
|
|
8
|
+
function PricingPlanModel(data) {
|
|
9
|
+
var _this = this;
|
|
10
|
+
this.id = data.id;
|
|
11
|
+
this.effective_from_date = data.effective_from_date;
|
|
12
|
+
this.effective_to_date = data.effective_to_date;
|
|
13
|
+
this.base_price = data.base_price;
|
|
14
|
+
this.unit = data.unit;
|
|
15
|
+
this.pitch_slab = {};
|
|
16
|
+
this.billing_cycle = {};
|
|
17
|
+
Object.keys(data.pitch_slab).forEach(function (key) {
|
|
18
|
+
_this.pitch_slab[key] = new pitch_slab_model_1.PitchSlabModel(data.pitch_slab[key]);
|
|
19
|
+
});
|
|
20
|
+
Object.keys(data.billing_cycle).forEach(function (key) {
|
|
21
|
+
_this.billing_cycle[key] = new billing_cycle_model_1.BillingCycleModel(data.billing_cycle[key]);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
PricingPlanModel.prototype.getPitchSlab = function (pitchCount) {
|
|
25
|
+
var pitchRangesMap = this.pitch_slab;
|
|
26
|
+
var pitchRanges = Object.values(pitchRangesMap);
|
|
27
|
+
var selectedPitchSlab = pitchRanges.filter(function (pitchRange) {
|
|
28
|
+
return pitchRange.from <= pitchCount && pitchCount <= pitchRange.to;
|
|
29
|
+
})[0];
|
|
30
|
+
return selectedPitchSlab;
|
|
31
|
+
};
|
|
32
|
+
PricingPlanModel.prototype.getBillingCycle = function (billingCycleKey) {
|
|
33
|
+
var billingCycleMap = this.billing_cycle;
|
|
34
|
+
var billingCycles = Object.values(billingCycleMap);
|
|
35
|
+
var selectedBillingCycle = billingCycles.filter(function (_a) {
|
|
36
|
+
var key = _a.key;
|
|
37
|
+
return key === billingCycleKey;
|
|
38
|
+
})[0];
|
|
39
|
+
return selectedBillingCycle;
|
|
40
|
+
};
|
|
41
|
+
PricingPlanModel.prototype.getMonth = function (billingCycleKey) {
|
|
42
|
+
return this.getBillingCycle(billingCycleKey).to;
|
|
43
|
+
};
|
|
44
|
+
PricingPlanModel.prototype.getNoOfSubscriptionDays = function (billingCycleKey) {
|
|
45
|
+
return this.getBillingCycle(billingCycleKey).to * 30 - 1;
|
|
46
|
+
};
|
|
47
|
+
PricingPlanModel.prototype.getBillingCycleKeys = function () {
|
|
48
|
+
return Object.values(this.billing_cycle).map(function (obj) { return obj.key; });
|
|
49
|
+
};
|
|
50
|
+
PricingPlanModel.prototype.validateBillingCycleKey = function (billingCycleKey) {
|
|
51
|
+
if (!this.getBillingCycleKeys().includes(billingCycleKey)) {
|
|
52
|
+
throw new app_badrequest_exception_1.AppBadRequestException({
|
|
53
|
+
key: "type",
|
|
54
|
+
message: ["pricing plan type:'".concat(billingCycleKey, "' is not found")],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
PricingPlanModel.prototype.getBillingCycleByDay = function (numberOfDay) {
|
|
59
|
+
return Object.values(this.billing_cycle).find(function (obj) {
|
|
60
|
+
if (numberOfDay <= obj.to * 30) {
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
return PricingPlanModel;
|
|
66
|
+
}());
|
|
67
|
+
exports.PricingPlanModel = PricingPlanModel;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IPricingPlanModel } from "../interface/pricing-plan.interface";
|
|
2
|
+
import { BillingCycleModel } from "./billing-cycle-model";
|
|
3
|
+
import { PitchSlabModel } from "./pitch-slab-model";
|
|
4
|
+
import { PricingPlanModel } from "./pricing-plan-model";
|
|
5
|
+
export declare class SubscribedPricingPlanModel extends PricingPlanModel {
|
|
6
|
+
pitchCount: number;
|
|
7
|
+
billingCycle: string;
|
|
8
|
+
selectedPitchSlab: PitchSlabModel;
|
|
9
|
+
selectedBillingCycle: BillingCycleModel;
|
|
10
|
+
selectedPitchSlabBasePrice: number;
|
|
11
|
+
hourInMonth: number;
|
|
12
|
+
months: number | undefined;
|
|
13
|
+
constructor(data: IPricingPlanModel, pitchCount: number, billingCycle: string);
|
|
14
|
+
getMonths(): number;
|
|
15
|
+
getBasePrice(): number;
|
|
16
|
+
getGrossAmount(): number;
|
|
17
|
+
getNetAmount(): number;
|
|
18
|
+
getBillingDiscount(): number;
|
|
19
|
+
getMonthDifference(that: SubscribedPricingPlanModel): number;
|
|
20
|
+
getGrossAmountByMonth(month: number): number;
|
|
21
|
+
getNetAmountByMonth(month: number): number;
|
|
22
|
+
getGrossAmountByPitchDays(pitchCount: number, days: number): number;
|
|
23
|
+
getNetAmountByPitchDays(pitchCount: number, days: number): number;
|
|
24
|
+
getGrossAmountByPitchDaysBasePrice(basePrice: number, pitchCount: number, days: number): number;
|
|
25
|
+
getNetAmountByPitchDaysBasePrice(basePrice: number, pitchCount: number, days: number): number;
|
|
26
|
+
}
|