turf-common 1.3.1-beta.8 → 1.3.1
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/interface/api/get-collection.interface.d.ts +1 -4
- package/build/jest.config.d.ts +3 -0
- package/build/jest.config.js +10 -0
- package/build/src/@enums/socket-io.d.ts +1 -0
- package/build/src/@enums/socket-io.js +17 -0
- package/build/src/@types/socket-io.d.ts +1 -0
- package/build/src/@types/socket-io.js +17 -0
- package/build/src/enums/availability-view.enum.d.ts +4 -0
- package/build/src/enums/availability-view.enum.js +8 -0
- package/build/src/enums/booking-details-status.enum.d.ts +4 -0
- package/build/src/enums/booking-details-status.enum.js +8 -0
- package/build/src/enums/booking-fetch-filter.enum.d.ts +5 -0
- package/build/src/enums/booking-fetch-filter.enum.js +9 -0
- package/build/src/enums/booking-history-operation-type.enum.d.ts +12 -0
- package/build/src/enums/booking-history-operation-type.enum.js +20 -0
- package/build/src/enums/bookings-status.enum.d.ts +5 -0
- package/build/src/enums/bookings-status.enum.js +9 -0
- package/build/src/enums/configuration-description.enum.d.ts +5 -0
- package/build/src/enums/configuration-description.enum.js +9 -0
- package/build/src/enums/configuration-key.enum.d.ts +10 -0
- package/build/src/enums/configuration-key.enum.js +29 -0
- package/build/src/enums/configuration-text.enum.d.ts +5 -0
- package/build/src/enums/configuration-text.enum.js +9 -0
- package/build/src/enums/cron-jobs-name.enum.d.ts +5 -0
- package/build/src/enums/cron-jobs-name.enum.js +9 -0
- package/build/src/enums/cron-jobs-status.enum.d.ts +5 -0
- package/build/src/enums/cron-jobs-status.enum.js +9 -0
- package/build/src/enums/environment.enum.d.ts +5 -0
- package/build/src/enums/environment.enum.js +9 -0
- package/build/src/enums/faqs-status.enum.d.ts +3 -0
- package/build/src/enums/faqs-status.enum.js +7 -0
- package/build/src/enums/modification-discount-policy.enum.d.ts +5 -0
- package/build/src/enums/modification-discount-policy.enum.js +9 -0
- package/build/src/enums/organization-status.enum.d.ts +15 -0
- package/build/src/enums/organization-status.enum.js +31 -0
- package/build/src/enums/organization-type.enum.d.ts +5 -0
- package/build/src/enums/organization-type.enum.js +9 -0
- package/build/src/enums/payment-mode.enum.d.ts +4 -0
- package/build/src/enums/payment-mode.enum.js +8 -0
- package/build/src/enums/pitch-operation.enum.d.ts +5 -0
- package/build/src/enums/pitch-operation.enum.js +9 -0
- package/build/src/enums/pitch-sports.enum.d.ts +7 -0
- package/build/src/enums/pitch-sports.enum.js +11 -0
- package/build/src/enums/pitch-status.enum.d.ts +12 -0
- package/build/src/enums/pitch-status.enum.js +13 -0
- package/build/src/enums/pricing-plan-status.enum.d.ts +4 -0
- package/build/src/enums/pricing-plan-status.enum.js +8 -0
- package/build/src/enums/registration-status-enum.d.ts +12 -0
- package/build/src/enums/registration-status-enum.js +16 -0
- package/build/src/enums/socket-io-booking-operation.enum.d.ts +6 -0
- package/build/src/enums/socket-io-booking-operation.enum.js +10 -0
- package/build/src/enums/subscription-status.enum.d.ts +23 -0
- package/build/src/enums/subscription-status.enum.js +40 -0
- package/build/src/enums/timezone.enum.d.ts +3 -0
- package/build/src/enums/timezone.enum.js +7 -0
- package/build/src/enums/transaction-type.enum.d.ts +7 -0
- package/build/src/enums/transaction-type.enum.js +11 -0
- package/build/src/enums/user-status.enum.d.ts +11 -0
- package/build/src/enums/user-status.enum.js +15 -0
- package/build/src/enums/valid-coupon-type.enum.d.ts +6 -0
- package/build/src/enums/valid-coupon-type.enum.js +10 -0
- package/build/src/enums/valid-type.enum.d.ts +6 -0
- package/build/src/enums/valid-type.enum.js +10 -0
- package/build/src/exceptions/app-badrequest.exception.d.ts +4 -0
- package/build/src/exceptions/app-badrequest.exception.js +28 -0
- package/build/src/interface/api/activate-subscription.interface.d.ts +10 -0
- package/build/src/interface/api/activate-subscription.interface.js +2 -0
- package/build/src/interface/api/booking-availablity-by-pitch.interface.d.ts +39 -0
- package/build/src/interface/api/booking-availablity-by-pitch.interface.js +2 -0
- package/build/src/interface/api/cancellation-charges.interface.d.ts +17 -0
- package/build/src/interface/api/cancellation-charges.interface.js +2 -0
- package/build/src/interface/api/create-bank-details.interface.d.ts +22 -0
- package/build/src/interface/api/create-bank-details.interface.js +2 -0
- package/build/src/interface/api/create-cancellation-policy.interface.d.ts +12 -0
- package/build/src/interface/api/create-cancellation-policy.interface.js +2 -0
- package/build/src/interface/api/create-coupon.interface.d.ts +11 -0
- package/build/src/interface/api/create-coupon.interface.js +2 -0
- package/build/src/interface/api/create-faqs.interface.d.ts +15 -0
- package/build/src/interface/api/create-faqs.interface.js +2 -0
- package/build/src/interface/api/create-organization.interface.d.ts +21 -0
- package/build/src/interface/api/create-organization.interface.js +2 -0
- package/build/src/interface/api/create-pricing-plan.interface.d.ts +16 -0
- package/build/src/interface/api/create-pricing-plan.interface.js +2 -0
- package/build/src/interface/api/create-recurring-slot-booking.interface.d.ts +29 -0
- package/build/src/interface/api/create-recurring-slot-booking.interface.js +2 -0
- package/build/src/interface/api/create-registration-interface.d.ts +13 -0
- package/build/src/interface/api/create-registration-interface.js +2 -0
- package/build/src/interface/api/create-registration-transaction-output.interface.d.ts +2 -0
- package/build/src/interface/api/create-registration-transaction-output.interface.js +2 -0
- package/build/src/interface/api/create-subscription.interface.d.ts +18 -0
- package/build/src/interface/api/create-subscription.interface.js +2 -0
- package/build/src/interface/api/create-turf.interface.d.ts +13 -0
- package/build/src/interface/api/create-turf.interface.js +2 -0
- package/build/src/interface/api/create-user.interface.d.ts +10 -0
- package/build/src/interface/api/create-user.interface.js +2 -0
- package/build/src/interface/api/delete-bank-details-by-id.interface.d.ts +6 -0
- package/build/src/interface/api/delete-bank-details-by-id.interface.js +2 -0
- package/build/src/interface/api/delete-booking-by-codes.interface.d.ts +7 -0
- package/build/src/interface/api/delete-booking-by-codes.interface.js +2 -0
- package/build/src/interface/api/delete-booking-info.interface.d.ts +3 -0
- package/build/src/interface/api/delete-booking-info.interface.js +2 -0
- package/build/src/interface/api/delete-pricing-plan.interface.d.ts +6 -0
- package/build/src/interface/api/delete-pricing-plan.interface.js +2 -0
- package/build/src/interface/api/get-all-booking-of-turf.interface.d.ts +23 -0
- package/build/src/interface/api/get-all-booking-of-turf.interface.js +2 -0
- package/build/src/interface/api/get-availability-by-turf.interface.d.ts +29 -0
- package/build/src/interface/api/get-availability-by-turf.interface.js +2 -0
- package/build/src/interface/api/get-bank-detail-by-id.interface.d.ts +6 -0
- package/build/src/interface/api/get-bank-detail-by-id.interface.js +2 -0
- package/build/src/interface/api/get-bank-detail-entities.interface.d.ts +6 -0
- package/build/src/interface/api/get-bank-detail-entities.interface.js +2 -0
- package/build/src/interface/api/get-booking-by-organization-id.interface.d.ts +30 -0
- package/build/src/interface/api/get-booking-by-organization-id.interface.js +2 -0
- package/build/src/interface/api/get-booking-customers.interface.d.ts +3 -0
- package/build/src/interface/api/get-booking-customers.interface.js +2 -0
- package/build/src/interface/api/get-booking-details-by-id.interface.d.ts +4 -0
- package/build/src/interface/api/get-booking-details-by-id.interface.js +2 -0
- package/build/src/interface/api/get-booking-history.interface.d.ts +4 -0
- package/build/src/interface/api/get-booking-history.interface.js +2 -0
- package/build/src/interface/api/get-booking-info.interface.d.ts +11 -0
- package/build/src/interface/api/get-booking-info.interface.js +2 -0
- package/build/src/interface/api/get-cancellation-policy-entity-by-org-id.interface.d.ts +15 -0
- package/build/src/interface/api/get-cancellation-policy-entity-by-org-id.interface.js +2 -0
- package/build/src/interface/api/get-cancelled-booking.interface.d.ts +7 -0
- package/build/src/interface/api/get-cancelled-booking.interface.js +2 -0
- package/build/src/interface/api/get-collection.interface.d.ts +24 -0
- package/build/src/interface/api/get-collection.interface.js +2 -0
- package/build/src/interface/api/get-configuration.interface.d.ts +4 -0
- package/build/src/interface/api/get-configuration.interface.js +2 -0
- package/build/src/interface/api/get-cron-job-by-date-range-name-status.interface.d.ts +12 -0
- package/build/src/interface/api/get-cron-job-by-date-range-name-status.interface.js +2 -0
- package/build/src/interface/api/get-current-subscription.interface.d.ts +18 -0
- package/build/src/interface/api/get-current-subscription.interface.js +2 -0
- package/build/src/interface/api/get-organization-by-orgid.interface.d.ts +15 -0
- package/build/src/interface/api/get-organization-by-orgid.interface.js +2 -0
- package/build/src/interface/api/get-price-by-organization-response.interface.d.ts +6 -0
- package/build/src/interface/api/get-price-by-organization-response.interface.js +2 -0
- package/build/src/interface/api/get-price-entity.interface.d.ts +10 -0
- package/build/src/interface/api/get-price-entity.interface.js +2 -0
- package/build/src/interface/api/get-price-query.interface.d.ts +10 -0
- package/build/src/interface/api/get-price-query.interface.js +2 -0
- package/build/src/interface/api/get-pricing-plan-by-date-response.interface.d.ts +23 -0
- package/build/src/interface/api/get-pricing-plan-by-date-response.interface.js +2 -0
- package/build/src/interface/api/get-pricing-plan-by-id.interface.d.ts +3 -0
- package/build/src/interface/api/get-pricing-plan-by-id.interface.js +2 -0
- package/build/src/interface/api/get-pricing-plan-entities.interface.d.ts +3 -0
- package/build/src/interface/api/get-pricing-plan-entities.interface.js +2 -0
- package/build/src/interface/api/get-registration-by-id.types.d.ts +20 -0
- package/build/src/interface/api/get-registration-by-id.types.js +2 -0
- package/build/src/interface/api/get-registration-entities.interface.d.ts +30 -0
- package/build/src/interface/api/get-registration-entities.interface.js +2 -0
- package/build/src/interface/api/get-sports.interface.d.ts +4 -0
- package/build/src/interface/api/get-sports.interface.js +2 -0
- package/build/src/interface/api/get-subscription-by-org-id.interface.d.ts +6 -0
- package/build/src/interface/api/get-subscription-by-org-id.interface.js +2 -0
- package/build/src/interface/api/get-subscription-entities.interface.d.ts +8 -0
- package/build/src/interface/api/get-subscription-entities.interface.js +2 -0
- package/build/src/interface/api/get-tournament.interface.d.ts +4 -0
- package/build/src/interface/api/get-tournament.interface.js +2 -0
- package/build/src/interface/api/get-turf-by-organization.interface.d.ts +6 -0
- package/build/src/interface/api/get-turf-by-organization.interface.js +2 -0
- package/build/src/interface/api/get-turf-entity-response.interface.d.ts +10 -0
- package/build/src/interface/api/get-turf-entity-response.interface.js +2 -0
- package/build/src/interface/api/index.d.ts +78 -0
- package/build/src/interface/api/index.js +96 -0
- package/build/src/interface/api/list-of-coupons.interface.d.ts +14 -0
- package/build/src/interface/api/list-of-coupons.interface.js +2 -0
- package/build/src/interface/api/login-response.interface.d.ts +22 -0
- package/build/src/interface/api/login-response.interface.js +2 -0
- package/build/src/interface/api/manual-trigger-cron-job.interface.d.ts +5 -0
- package/build/src/interface/api/manual-trigger-cron-job.interface.js +2 -0
- package/build/src/interface/api/one-slot-booking.interface.d.ts +24 -0
- package/build/src/interface/api/one-slot-booking.interface.js +2 -0
- package/build/src/interface/api/renew-subscription.interface.d.ts +19 -0
- package/build/src/interface/api/renew-subscription.interface.js +2 -0
- package/build/src/interface/api/set-price.interface.d.ts +6 -0
- package/build/src/interface/api/set-price.interface.js +2 -0
- package/build/src/interface/api/setup-registration.interface.d.ts +5 -0
- package/build/src/interface/api/setup-registration.interface.js +2 -0
- package/build/src/interface/api/staff-member-list.interface.d.ts +9 -0
- package/build/src/interface/api/staff-member-list.interface.js +2 -0
- package/build/src/interface/api/update-bank-detail.interface.d.ts +17 -0
- package/build/src/interface/api/update-bank-detail.interface.js +2 -0
- package/build/src/interface/api/update-booking-by-code-response.interface.d.ts +7 -0
- package/build/src/interface/api/update-booking-by-code-response.interface.js +2 -0
- package/build/src/interface/api/update-configuration.interface.d.ts +10 -0
- package/build/src/interface/api/update-configuration.interface.js +2 -0
- package/build/src/interface/api/update-coupon.interface.d.ts +9 -0
- package/build/src/interface/api/update-coupon.interface.js +2 -0
- package/build/src/interface/api/update-faqs-steps.interface.d.ts +11 -0
- package/build/src/interface/api/update-faqs-steps.interface.js +2 -0
- package/build/src/interface/api/update-faqs.interface.d.ts +6 -0
- package/build/src/interface/api/update-faqs.interface.js +2 -0
- package/build/src/interface/api/update-organization.interface.d.ts +21 -0
- package/build/src/interface/api/update-organization.interface.js +2 -0
- package/build/src/interface/api/update-pricing-plan-by-id.interface.d.ts +20 -0
- package/build/src/interface/api/update-pricing-plan-by-id.interface.js +2 -0
- package/build/src/interface/api/update-recurring-booking.interface.d.ts +52 -0
- package/build/src/interface/api/update-recurring-booking.interface.js +2 -0
- package/build/src/interface/api/update-registration-entities.interface.d.ts +8 -0
- package/build/src/interface/api/update-registration-entities.interface.js +2 -0
- package/build/src/interface/api/update-sports-interface.d.ts +3 -0
- package/build/src/interface/api/update-sports-interface.js +2 -0
- package/build/src/interface/api/update-staff-member.interface.d.ts +16 -0
- package/build/src/interface/api/update-staff-member.interface.js +2 -0
- package/build/src/interface/api/update-subscription.interface.d.ts +23 -0
- package/build/src/interface/api/update-subscription.interface.js +2 -0
- package/build/src/interface/api/update-turf-details.interface.d.ts +20 -0
- package/build/src/interface/api/update-turf-details.interface.js +2 -0
- package/build/src/interface/api/update-turf-transaction-output.d.ts +3 -0
- package/build/src/interface/api/update-turf-transaction-output.js +2 -0
- package/build/src/interface/api/upgrade-renew-subscription.interface.d.ts +10 -0
- package/build/src/interface/api/upgrade-renew-subscription.interface.js +2 -0
- package/build/src/interface/api/upgrade-subscription.interface.d.ts +21 -0
- package/build/src/interface/api/upgrade-subscription.interface.js +2 -0
- package/build/src/interface/api/userentity-without-password.interface.d.ts +5 -0
- package/build/src/interface/api/userentity-without-password.interface.js +2 -0
- package/build/src/interface/api/utils.d.ts +18 -0
- package/build/src/interface/api/utils.js +48 -0
- package/build/src/interface/billing-cycle-dto.interface.d.ts +8 -0
- package/build/src/interface/billing-cycle-dto.interface.js +2 -0
- package/build/src/interface/billing-cycle.interface.d.ts +7 -0
- package/build/src/interface/billing-cycle.interface.js +2 -0
- package/build/src/interface/booking-details-with-code.interface.d.ts +34 -0
- package/build/src/interface/booking-details-with-code.interface.js +2 -0
- package/build/src/interface/controller.interface.d.ts +6 -0
- package/build/src/interface/controller.interface.js +2 -0
- package/build/src/interface/convert-to-midnight-time.interface.d.ts +5 -0
- package/build/src/interface/convert-to-midnight-time.interface.js +2 -0
- package/build/src/interface/date-formatter.interface.d.ts +4 -0
- package/build/src/interface/date-formatter.interface.js +2 -0
- package/build/src/interface/dto/delete-booking-by-codes-dto.interface.d.ts +7 -0
- package/build/src/interface/dto/delete-booking-by-codes-dto.interface.js +2 -0
- package/build/src/interface/dto/update-booking-by-code-dto.interface.d.ts +13 -0
- package/build/src/interface/dto/update-booking-by-code-dto.interface.js +2 -0
- package/build/src/interface/entity/bank-details-entity.interface.d.ts +12 -0
- package/build/src/interface/entity/bank-details-entity.interface.js +2 -0
- package/build/src/interface/entity/booking-cancellation-entity.interface.d.ts +32 -0
- package/build/src/interface/entity/booking-cancellation-entity.interface.js +2 -0
- package/build/src/interface/entity/booking-customer-entity.interface.d.ts +8 -0
- package/build/src/interface/entity/booking-customer-entity.interface.js +2 -0
- package/build/src/interface/entity/booking-details-entity.interface.d.ts +29 -0
- package/build/src/interface/entity/booking-details-entity.interface.js +2 -0
- package/build/src/interface/entity/booking-history-entity.interface.d.ts +35 -0
- package/build/src/interface/entity/booking-history-entity.interface.js +2 -0
- package/build/src/interface/entity/booking-payment-history-entity.interface.d.ts +13 -0
- package/build/src/interface/entity/booking-payment-history-entity.interface.js +2 -0
- package/build/src/interface/entity/bookings-entity.interface.d.ts +6 -0
- package/build/src/interface/entity/bookings-entity.interface.js +2 -0
- package/build/src/interface/entity/cancellation-policy-entity.interface.d.ts +8 -0
- package/build/src/interface/entity/cancellation-policy-entity.interface.js +2 -0
- package/build/src/interface/entity/configurations-entity.interface.d.ts +9 -0
- package/build/src/interface/entity/configurations-entity.interface.js +2 -0
- package/build/src/interface/entity/coupon.entity.interface.d.ts +10 -0
- package/build/src/interface/entity/coupon.entity.interface.js +2 -0
- package/build/src/interface/entity/cron-jobs-entity.interface.d.ts +12 -0
- package/build/src/interface/entity/cron-jobs-entity.interface.js +2 -0
- package/build/src/interface/entity/entity-audit-column.interface.d.ts +12 -0
- package/build/src/interface/entity/entity-audit-column.interface.js +9 -0
- package/build/src/interface/entity/faqs-entity.interface.d.ts +10 -0
- package/build/src/interface/entity/faqs-entity.interface.js +2 -0
- package/build/src/interface/entity/index.d.ts +23 -0
- package/build/src/interface/entity/index.js +39 -0
- package/build/src/interface/entity/organization-entity.interface.d.ts +24 -0
- package/build/src/interface/entity/organization-entity.interface.js +2 -0
- package/build/src/interface/entity/pitch-entity.interface.d.ts +9 -0
- package/build/src/interface/entity/pitch-entity.interface.js +2 -0
- package/build/src/interface/entity/price-entity.interface.d.ts +5 -0
- package/build/src/interface/entity/price-entity.interface.js +2 -0
- package/build/src/interface/entity/pricing-plan-entity.interface.d.ts +16 -0
- package/build/src/interface/entity/pricing-plan-entity.interface.js +2 -0
- package/build/src/interface/entity/registration-entity.interface.d.ts +12 -0
- package/build/src/interface/entity/registration-entity.interface.js +2 -0
- package/build/src/interface/entity/sports-entity.interface.d.ts +6 -0
- package/build/src/interface/entity/sports-entity.interface.js +2 -0
- package/build/src/interface/entity/subscription-entity.interface.d.ts +26 -0
- package/build/src/interface/entity/subscription-entity.interface.js +2 -0
- package/build/src/interface/entity/subscription-pitch-mapping.interface.d.ts +8 -0
- package/build/src/interface/entity/subscription-pitch-mapping.interface.js +2 -0
- package/build/src/interface/entity/turf-entity.interface.d.ts +17 -0
- package/build/src/interface/entity/turf-entity.interface.js +2 -0
- package/build/src/interface/entity/user-entity.interface.d.ts +24 -0
- package/build/src/interface/entity/user-entity.interface.js +2 -0
- package/build/src/interface/formate-date-and-time.interface.d.ts +6 -0
- package/build/src/interface/formate-date-and-time.interface.js +2 -0
- package/build/src/interface/get-booking-by-id.interface.d.ts +56 -0
- package/build/src/interface/get-booking-by-id.interface.js +2 -0
- package/build/src/interface/get-booking-codes-per-thirty-min.interface.d.ts +4 -0
- package/build/src/interface/get-booking-codes-per-thirty-min.interface.js +2 -0
- package/build/src/interface/get-pricing-plan-by-date-response.interface.d.ts +23 -0
- package/build/src/interface/get-pricing-plan-by-date-response.interface.js +2 -0
- package/build/src/interface/get-turf-entity.interface.d.ts +34 -0
- package/build/src/interface/get-turf-entity.interface.js +2 -0
- package/build/src/interface/key-value.interface.d.ts +3 -0
- package/build/src/interface/key-value.interface.js +2 -0
- package/build/src/interface/model/booking-details-model.interface.d.ts +5 -0
- package/build/src/interface/model/booking-details-model.interface.js +2 -0
- package/build/src/interface/model/booking-entity-model.interface.d.ts +8 -0
- package/build/src/interface/model/booking-entity-model.interface.js +2 -0
- package/build/src/interface/model/cancellation-policy-model.interface.d.ts +4 -0
- package/build/src/interface/model/cancellation-policy-model.interface.js +2 -0
- package/build/src/interface/model/charge-model.interface.d.ts +13 -0
- package/build/src/interface/model/charge-model.interface.js +2 -0
- package/build/src/interface/model/configuration-model.interface.d.ts +4 -0
- package/build/src/interface/model/configuration-model.interface.js +2 -0
- package/build/src/interface/model/index.d.ts +10 -0
- package/build/src/interface/model/index.js +26 -0
- package/build/src/interface/model/price-model.interface.d.ts +3 -0
- package/build/src/interface/model/price-model.interface.js +2 -0
- package/build/src/interface/model/pricing-plan-entity-model.interface.d.ts +13 -0
- package/build/src/interface/model/pricing-plan-entity-model.interface.js +2 -0
- package/build/src/interface/model/pricing-plan-model.interface.d.ts +15 -0
- package/build/src/interface/model/pricing-plan-model.interface.js +2 -0
- package/build/src/interface/model/turf-model.interface.d.ts +7 -0
- package/build/src/interface/model/turf-model.interface.js +2 -0
- package/build/src/interface/model/user-model.interface.d.ts +3 -0
- package/build/src/interface/model/user-model.interface.js +2 -0
- package/build/src/interface/modify-entity.interface.d.ts +5 -0
- package/build/src/interface/modify-entity.interface.js +2 -0
- package/build/src/interface/modify-turf.interface.d.ts +7 -0
- package/build/src/interface/modify-turf.interface.js +2 -0
- package/build/src/interface/modify.interface.d.ts +1 -0
- package/build/src/interface/modify.interface.js +2 -0
- package/build/src/interface/ng-date-structure.interface.d.ts +5 -0
- package/build/src/interface/ng-date-structure.interface.js +2 -0
- package/build/src/interface/pitch-slab-dto.interface.d.ts +8 -0
- package/build/src/interface/pitch-slab-dto.interface.js +2 -0
- package/build/src/interface/pitch-slab.interface.d.ts +5 -0
- package/build/src/interface/pitch-slab.interface.js +2 -0
- package/build/src/interface/pricing-plan.interface.d.ts +15 -0
- package/build/src/interface/pricing-plan.interface.js +2 -0
- package/build/src/interface/socket-io-bookings.interface.d.ts +12 -0
- package/build/src/interface/socket-io-bookings.interface.js +2 -0
- package/build/src/interface/time-formatter.interface.d.ts +4 -0
- package/build/src/interface/time-formatter.interface.js +2 -0
- package/build/src/interface/ui/booking-data.interface.d.ts +6 -0
- package/build/src/interface/ui/booking-data.interface.js +2 -0
- package/build/src/interface/ui/upgrade-subscription-data.interface.d.ts +15 -0
- package/build/src/interface/ui/upgrade-subscription-data.interface.js +2 -0
- package/build/src/interface/upload-multer-file.interface.d.ts +9 -0
- package/build/src/interface/upload-multer-file.interface.js +2 -0
- package/build/src/interface/user-info-dto.interface.d.ts +16 -0
- package/build/src/interface/user-info-dto.interface.js +2 -0
- package/build/src/interface/without-token-registration-entity.types.d.ts +3 -0
- package/build/src/interface/without-token-registration-entity.types.js +2 -0
- package/build/src/models/billing-cycle-model.d.ts +11 -0
- package/build/src/models/billing-cycle-model.js +27 -0
- package/build/src/models/booking-code-model.d.ts +139 -0
- package/build/src/models/booking-code-model.js +624 -0
- package/build/src/models/charge-model.d.ts +34 -0
- package/build/src/models/charge-model.js +275 -0
- package/build/src/models/entity/booking-details-model.d.ts +41 -0
- package/build/src/models/entity/booking-details-model.js +69 -0
- package/build/src/models/entity/booking-entity-model.d.ts +21 -0
- package/build/src/models/entity/booking-entity-model.js +47 -0
- package/build/src/models/entity/booking-payment-history-model.d.ts +20 -0
- package/build/src/models/entity/booking-payment-history-model.js +36 -0
- package/build/src/models/entity/cancellation-policy-model.d.ts +18 -0
- package/build/src/models/entity/cancellation-policy-model.js +32 -0
- package/build/src/models/entity/configuration-model.d.ts +17 -0
- package/build/src/models/entity/configuration-model.js +17 -0
- package/build/src/models/entity/index.d.ts +10 -0
- package/build/src/models/entity/index.js +26 -0
- package/build/src/models/entity/price-model.d.ts +11 -0
- package/build/src/models/entity/price-model.js +15 -0
- package/build/src/models/entity/pricing-plan-entity-model.d.ts +47 -0
- package/build/src/models/entity/pricing-plan-entity-model.js +128 -0
- package/build/src/models/entity/subscription-model.d.ts +44 -0
- package/build/src/models/entity/subscription-model.js +154 -0
- package/build/src/models/entity/turf-model.d.ts +36 -0
- package/build/src/models/entity/turf-model.js +116 -0
- package/build/src/models/entity/user-model.d.ts +32 -0
- package/build/src/models/entity/user-model.js +19 -0
- package/build/src/models/pitch-slab-model.d.ts +9 -0
- package/build/src/models/pitch-slab-model.js +21 -0
- package/build/src/models/pricing-plan-model.d.ts +27 -0
- package/build/src/models/pricing-plan-model.js +89 -0
- package/build/src/models/subscribed-pricing-plan-model.d.ts +37 -0
- package/build/src/models/subscribed-pricing-plan-model.js +122 -0
- package/build/src/models/time-slot-model.d.ts +19 -0
- package/build/src/models/time-slot-model.js +98 -0
- package/build/src/models/turf-availability-model.d.ts +57 -0
- package/build/src/models/turf-availability-model.js +239 -0
- package/build/src/types/app-badrequest-exception.type.d.ts +4 -0
- package/build/src/types/app-badrequest-exception.type.js +2 -0
- package/build/src/types/booking-modification.type.d.ts +6 -0
- package/build/src/types/booking-modification.type.js +2 -0
- package/build/src/types/bookingdetails-with-booking.type.d.ts +9 -0
- package/build/src/types/bookingdetails-with-booking.type.js +2 -0
- package/build/src/types/date-wise-payment-history-data.types.d.ts +9 -0
- package/build/src/types/date-wise-payment-history-data.types.js +2 -0
- package/build/src/utils/constant.d.ts +5 -0
- package/build/src/utils/constant.js +8 -0
- package/build/src/utils/date-util.d.ts +56 -0
- package/build/src/utils/date-util.js +157 -0
- package/build/src/utils/math-util.d.ts +14 -0
- package/build/src/utils/math-util.js +39 -0
- package/build/src/utils/string-utils.d.ts +31 -0
- package/build/src/utils/string-utils.js +82 -0
- package/build/tests/unit/charges/across-dates/across-dates-booking-TURF-476.spec.d.ts +1 -0
- package/build/tests/unit/charges/across-dates/across-dates-booking-TURF-476.spec.js +114 -0
- package/build/tests/unit/charges/across-dates/across-dates-booking-without-discount-TURF-476.e2e-spec.d.ts +1 -0
- package/build/tests/unit/charges/across-dates/across-dates-booking-without-discount-TURF-476.e2e-spec.js +114 -0
- package/build/tests/unit/charges/across-dates/across-dates-discount-TURF-476.spec.d.ts +1 -0
- package/build/tests/unit/charges/across-dates/across-dates-discount-TURF-476.spec.js +114 -0
- package/build/tests/unit/charges/across-dates/across-dates-extend-remove-TURF-476.spec.d.ts +1 -0
- package/build/tests/unit/charges/across-dates/across-dates-extend-remove-TURF-476.spec.js +114 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-half-amount-paid.spec.d.ts +1 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-half-amount-paid.spec.js +221 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid-cancellation-not-present.spec.d.ts +1 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid-cancellation-not-present.spec.js +518 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid.spec.d.ts +1 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid.spec.js +470 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-paid.spec.d.ts +1 -0
- package/build/tests/unit/charges/discount-conditional/basic-amount-paid.spec.js +263 -0
- package/build/tests/unit/charges/discount-conditional/basic.-amount-not-paid.spec.d.ts +1 -0
- package/build/tests/unit/charges/discount-conditional/basic.-amount-not-paid.spec.js +223 -0
- package/build/tests/unit/charges/discount-conditional/decimal-discount.spec.d.ts +1 -0
- package/build/tests/unit/charges/discount-conditional/decimal-discount.spec.js +509 -0
- package/build/tests/unit/charges/per-hour-unit/phu-basic-amount-not-paid-TURF-486.spec.d.ts +1 -0
- package/build/tests/unit/charges/per-hour-unit/phu-basic-amount-not-paid-TURF-486.spec.js +148 -0
- package/build/tests/utils/models/booking-entity-test.d.ts +9 -0
- package/build/tests/utils/models/booking-entity-test.js +28 -0
- package/package.json +6 -2
- /package/build/{@enum.d.ts → src/@enum.d.ts} +0 -0
- /package/build/{@enum.js → src/@enum.js} +0 -0
- /package/build/{@model.d.ts → src/@model.d.ts} +0 -0
- /package/build/{@model.js → src/@model.js} +0 -0
- /package/build/{@type.d.ts → src/@type.d.ts} +0 -0
- /package/build/{@type.js → src/@type.js} +0 -0
- /package/build/{@utils.d.ts → src/@utils.d.ts} +0 -0
- /package/build/{@utils.js → src/@utils.js} +0 -0
- /package/build/{index.d.ts → src/index.d.ts} +0 -0
- /package/build/{index.js → src/index.js} +0 -0
|
@@ -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,44 @@
|
|
|
1
|
+
import { IGetCurrentSubscriptionResponse, ISubscriptionPitchMappingEntity } from "../../@type";
|
|
2
|
+
import { SubscriptionStatus } from "../../enums/subscription-status.enum";
|
|
3
|
+
import { ISubscriptionEntity, ISubscriptionModel } from "../../interface/entity/subscription-entity.interface";
|
|
4
|
+
import { RenewSubscriptionData, UpgradeSubscriptionData } from "../../interface/ui/upgrade-subscription-data.interface";
|
|
5
|
+
import { PricingPlanModel } from "../pricing-plan-model";
|
|
6
|
+
import { SubscribedPricingPlanModel } from "../subscribed-pricing-plan-model";
|
|
7
|
+
export declare class SubscriptionModel implements ISubscriptionModel {
|
|
8
|
+
id: number;
|
|
9
|
+
organizationId: number;
|
|
10
|
+
from: Date;
|
|
11
|
+
to: Date;
|
|
12
|
+
type: string;
|
|
13
|
+
grossAmount: number;
|
|
14
|
+
discount: string;
|
|
15
|
+
netAmount: number;
|
|
16
|
+
amountPaid: number;
|
|
17
|
+
status: SubscriptionStatus;
|
|
18
|
+
noOfPitches: number;
|
|
19
|
+
remarks: string;
|
|
20
|
+
registrationId: number;
|
|
21
|
+
pricingPlanId: number;
|
|
22
|
+
previousSubscriptionIds: string;
|
|
23
|
+
createdOn: Date;
|
|
24
|
+
updatedOn: Date;
|
|
25
|
+
createdBy: number;
|
|
26
|
+
updatedBy: number;
|
|
27
|
+
fromDateCode: string;
|
|
28
|
+
toDateCode: string;
|
|
29
|
+
details?: ISubscriptionPitchMappingEntity[];
|
|
30
|
+
advanceAmount?: number;
|
|
31
|
+
constructor(data: ISubscriptionEntity);
|
|
32
|
+
static getInstanceByResponse(data: IGetCurrentSubscriptionResponse): SubscriptionModel;
|
|
33
|
+
getFromDate(): Date;
|
|
34
|
+
getToDate(): Date;
|
|
35
|
+
isRenewalDue(): boolean;
|
|
36
|
+
remainingSubscriptionDays(): number;
|
|
37
|
+
upgradeSubscription(totalPitchCount: number, subscribedPricingModel: SubscribedPricingPlanModel): UpgradeSubscriptionData;
|
|
38
|
+
renewSubscription(totalPitchCount: number, billingCycle: string, currentPricingPlanModel: PricingPlanModel): RenewSubscriptionData;
|
|
39
|
+
static updateStatus(subscriptionEntities: ISubscriptionEntity[], status: SubscriptionStatus, userId: number): ISubscriptionEntity[];
|
|
40
|
+
remainingAmount(): number;
|
|
41
|
+
isAmountFullyPaid(): boolean;
|
|
42
|
+
isAmountPaidGreater(): boolean;
|
|
43
|
+
updateStatusIfPaymentDone(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
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.SubscriptionModel = void 0;
|
|
15
|
+
var subscription_status_enum_1 = require("../../enums/subscription-status.enum");
|
|
16
|
+
var constant_1 = require("../../utils/constant");
|
|
17
|
+
var date_util_1 = require("../../utils/date-util");
|
|
18
|
+
var subscribed_pricing_plan_model_1 = require("../subscribed-pricing-plan-model");
|
|
19
|
+
var SubscriptionModel = /** @class */ (function () {
|
|
20
|
+
function SubscriptionModel(data) {
|
|
21
|
+
Object.assign(this, data);
|
|
22
|
+
}
|
|
23
|
+
SubscriptionModel.getInstanceByResponse = function (data) {
|
|
24
|
+
// this.id = data.id;
|
|
25
|
+
// this.organizationId = data.organizationId;
|
|
26
|
+
// this.from = data.from;
|
|
27
|
+
// this.to = data.to;
|
|
28
|
+
// this.type = data.type;
|
|
29
|
+
// this.grossAmount = data.grossAmount;
|
|
30
|
+
// this.discount = data.discount;
|
|
31
|
+
// this.netAmount = data.netAmount;
|
|
32
|
+
// this.amountPaid = data.amountPaid;
|
|
33
|
+
// this.status = data.status;
|
|
34
|
+
// this.noOfPitches = data.noOfPitches;
|
|
35
|
+
// this.createdBy = data.createdBy;
|
|
36
|
+
// this.createdOn = data.createdOn;
|
|
37
|
+
// this.updatedBy = data.updatedBy;
|
|
38
|
+
// this.updatedOn = data.updatedOn;
|
|
39
|
+
// this.remarks = data.remarks;
|
|
40
|
+
// this.registrationId = data.registrationId;
|
|
41
|
+
// this.pricingPlanId = data.pricingPlanId;
|
|
42
|
+
// this.upgradeSubscriptionId = Number(data.previousSubscriptionIds);
|
|
43
|
+
// this.details = data.details;
|
|
44
|
+
var demo = __assign(__assign({}, data), { from: date_util_1.dateUtilService.getDateFromDatabaseDate(data.from), to: date_util_1.dateUtilService.getDateFromDatabaseDate(data.to), createdOn: date_util_1.dateUtilService.getDateFromDatabaseDate(data.createdOn), updatedOn: date_util_1.dateUtilService.getDateFromDatabaseDate(data.updatedOn) });
|
|
45
|
+
return new SubscriptionModel(demo);
|
|
46
|
+
};
|
|
47
|
+
SubscriptionModel.prototype.getFromDate = function () {
|
|
48
|
+
return date_util_1.dateUtilService.convertStringToDate(this.fromDateCode, "yyMMdd");
|
|
49
|
+
};
|
|
50
|
+
SubscriptionModel.prototype.getToDate = function () {
|
|
51
|
+
return date_util_1.dateUtilService.convertStringToDate(this.toDateCode, "yyMMdd");
|
|
52
|
+
};
|
|
53
|
+
SubscriptionModel.prototype.isRenewalDue = function () {
|
|
54
|
+
// Check if difference 'to' date and today's date is less than 7 days
|
|
55
|
+
return (this.getToDate().getTime() - new Date().getTime() <
|
|
56
|
+
constant_1.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS * 24 * 60 * 60 * 1000);
|
|
57
|
+
};
|
|
58
|
+
SubscriptionModel.prototype.remainingSubscriptionDays = function () {
|
|
59
|
+
// const oneDay = 24 * 60 * 60 * 1000;
|
|
60
|
+
// const dayDifference = Math.ceil(
|
|
61
|
+
// (this.to.getTime() - new Date().getTime()) / oneDay
|
|
62
|
+
// );
|
|
63
|
+
// return dayDifference - 1; //minus 1 day
|
|
64
|
+
return date_util_1.dateUtilService.noOfDaysBetweenDates(new Date(), this.getToDate());
|
|
65
|
+
};
|
|
66
|
+
SubscriptionModel.prototype.upgradeSubscription = function (totalPitchCount, subscribedPricingModel) {
|
|
67
|
+
var newlyAddedPitchCount = totalPitchCount - this.noOfPitches;
|
|
68
|
+
var basePrice = subscribedPricingModel.getSelectedPitchSlabBasePrice();
|
|
69
|
+
var remainingSubscriptionDays = this.remainingSubscriptionDays();
|
|
70
|
+
var additionalGrossAmount = basePrice * remainingSubscriptionDays * 24 * newlyAddedPitchCount;
|
|
71
|
+
return {
|
|
72
|
+
amountPaid: this.amountPaid,
|
|
73
|
+
discount: this.discount,
|
|
74
|
+
from: this.from,
|
|
75
|
+
to: this.to,
|
|
76
|
+
noOfPitches: totalPitchCount,
|
|
77
|
+
netAmount: Math.round(this.netAmount + additionalGrossAmount),
|
|
78
|
+
grossAmount: Math.round(this.grossAmount + additionalGrossAmount),
|
|
79
|
+
organizationId: this.organizationId,
|
|
80
|
+
pricingPlanId: this.pricingPlanId,
|
|
81
|
+
registrationId: this.registrationId,
|
|
82
|
+
type: this.type,
|
|
83
|
+
previousSubscriptionIds: this.id.toString(),
|
|
84
|
+
newlyAddedPitchCount: newlyAddedPitchCount,
|
|
85
|
+
basePrice: basePrice,
|
|
86
|
+
remainingSubscriptionDays: remainingSubscriptionDays,
|
|
87
|
+
additionalGrossAmount: Math.round(additionalGrossAmount),
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
SubscriptionModel.prototype.renewSubscription = function (totalPitchCount, billingCycle, currentPricingPlanModel) {
|
|
91
|
+
// const dateUtilService = new DateUtilService();
|
|
92
|
+
// dateService.convertStringToDate(this.from, "yyyy-MM-dd");
|
|
93
|
+
// const subscribedPitchCount: number = this.noOfPitches;
|
|
94
|
+
var renewalSubscriptionModel = new subscribed_pricing_plan_model_1.SubscribedPricingPlanModel(currentPricingPlanModel, totalPitchCount, billingCycle);
|
|
95
|
+
var toDate = this.getToDate();
|
|
96
|
+
var _a = renewalSubscriptionModel.getNextBillingCycleDateRange(toDate), startDate = _a[0], endDate = _a[1];
|
|
97
|
+
// const [startDateCode, endDateCode]: [string, string] = [
|
|
98
|
+
// dateService.getDateCode(startDate),
|
|
99
|
+
// dateService.getDateCode(endDate),
|
|
100
|
+
// ];
|
|
101
|
+
return {
|
|
102
|
+
amountPaid: 0,
|
|
103
|
+
discount: renewalSubscriptionModel.selectedBillingCycle.discount,
|
|
104
|
+
fromDate: startDate,
|
|
105
|
+
grossAmount: Math.round(renewalSubscriptionModel.getGrossAmount()),
|
|
106
|
+
netAmount: Math.round(renewalSubscriptionModel.getNetAmount()),
|
|
107
|
+
noOfPitches: totalPitchCount,
|
|
108
|
+
pricingPlanId: currentPricingPlanModel.id,
|
|
109
|
+
toDate: endDate,
|
|
110
|
+
type: billingCycle,
|
|
111
|
+
organizationId: this.organizationId,
|
|
112
|
+
registrationId: this.registrationId,
|
|
113
|
+
previousSubscriptionIds: null,
|
|
114
|
+
basePrice: renewalSubscriptionModel.getSelectedPitchSlabBasePrice(),
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
SubscriptionModel.updateStatus = function (subscriptionEntities, status, userId) {
|
|
118
|
+
return subscriptionEntities.map(function (subscriptionEntity) {
|
|
119
|
+
subscriptionEntity.status = status;
|
|
120
|
+
subscriptionEntity.updatedBy = userId;
|
|
121
|
+
subscriptionEntity.updatedOn = new Date();
|
|
122
|
+
return subscriptionEntity;
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
SubscriptionModel.prototype.remainingAmount = function () {
|
|
126
|
+
return this.netAmount - this.amountPaid;
|
|
127
|
+
};
|
|
128
|
+
SubscriptionModel.prototype.isAmountFullyPaid = function () {
|
|
129
|
+
if (this.netAmount === this.amountPaid) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
};
|
|
134
|
+
SubscriptionModel.prototype.isAmountPaidGreater = function () {
|
|
135
|
+
if (this.amountPaid > this.netAmount) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
139
|
+
};
|
|
140
|
+
SubscriptionModel.prototype.updateStatusIfPaymentDone = function () {
|
|
141
|
+
if (this.isAmountFullyPaid()) {
|
|
142
|
+
this.status =
|
|
143
|
+
this.status === subscription_status_enum_1.SubscriptionStatus.UPGRADE_PAYMENT_PENDING
|
|
144
|
+
? subscription_status_enum_1.SubscriptionStatus.UPGRADE_PAYMENT_DONE
|
|
145
|
+
: this.status === subscription_status_enum_1.SubscriptionStatus.UPGRADE_RENEW_PAYMENT_PENDING
|
|
146
|
+
? subscription_status_enum_1.SubscriptionStatus.UPGRADE_RENEW_PAYMENT_DONE
|
|
147
|
+
: this.status === subscription_status_enum_1.SubscriptionStatus.PAYMENT_PENDING
|
|
148
|
+
? subscription_status_enum_1.SubscriptionStatus.PAYMENT_DONE
|
|
149
|
+
: this.status;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
return SubscriptionModel;
|
|
153
|
+
}());
|
|
154
|
+
exports.SubscriptionModel = SubscriptionModel;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
import { IModifyTurf } from "../../interface/modify-turf.interface";
|
|
10
|
+
import { IModifyEntity } from "../../@type";
|
|
11
|
+
export declare class TurfModel implements ITurfModel {
|
|
12
|
+
id: number;
|
|
13
|
+
turfName: string;
|
|
14
|
+
numberOfPitches: number;
|
|
15
|
+
address: string;
|
|
16
|
+
org_id: number;
|
|
17
|
+
adhocRefund: boolean;
|
|
18
|
+
createdOn: Date;
|
|
19
|
+
updatedOn: Date;
|
|
20
|
+
createdBy: number;
|
|
21
|
+
updatedBy: number;
|
|
22
|
+
pitches: IPitchEntity[];
|
|
23
|
+
organization: IOrganizationEntity;
|
|
24
|
+
Users: IUserEntity[];
|
|
25
|
+
constructor(data: ITurfEntity);
|
|
26
|
+
getPitchStatusCount(): IPitchStatus;
|
|
27
|
+
getModifiedTurfEntity(): ITurf;
|
|
28
|
+
static toMap(turfEntities: ITurfModel[]): {
|
|
29
|
+
[key: number]: IModifyTurf;
|
|
30
|
+
};
|
|
31
|
+
static toKeyValue(turfEntities: ITurfEntity[]): {
|
|
32
|
+
[key: number]: ITurfEntity;
|
|
33
|
+
};
|
|
34
|
+
static fromEntity(data: ITurfEntity): ITurfModel;
|
|
35
|
+
static filterBySubscriptionPitchMapping(turfEntities: ITurfEntity[], subscriptionPitchMappingEntities: IModifyEntity<ISubscriptionPitchMappingEntity>[], pitchStatusSet: Set<string>): ITurfEntity[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.TurfModel = void 0;
|
|
26
|
+
var pitch_status_enum_1 = require("../../enums/pitch-status.enum");
|
|
27
|
+
var _utils_1 = require("../../@utils");
|
|
28
|
+
var TurfModel = /** @class */ (function () {
|
|
29
|
+
function TurfModel(data) {
|
|
30
|
+
Object.assign(this, data);
|
|
31
|
+
}
|
|
32
|
+
TurfModel.prototype.getPitchStatusCount = function () {
|
|
33
|
+
var statusCount = {};
|
|
34
|
+
for (var _i = 0, _a = Object.values(pitch_status_enum_1.PitchStatus); _i < _a.length; _i++) {
|
|
35
|
+
var status_1 = _a[_i];
|
|
36
|
+
statusCount[status_1] = 0;
|
|
37
|
+
}
|
|
38
|
+
for (var _b = 0, _c = this.pitches; _b < _c.length; _b++) {
|
|
39
|
+
var pitch = _c[_b];
|
|
40
|
+
statusCount[pitch.status] += 1;
|
|
41
|
+
}
|
|
42
|
+
return statusCount;
|
|
43
|
+
};
|
|
44
|
+
TurfModel.prototype.getModifiedTurfEntity = function () {
|
|
45
|
+
return {
|
|
46
|
+
id: this.id,
|
|
47
|
+
turfName: this.turfName,
|
|
48
|
+
numberOfPitches: this.numberOfPitches,
|
|
49
|
+
address: this.address,
|
|
50
|
+
org_id: this.org_id,
|
|
51
|
+
updatedBy: this.updatedBy,
|
|
52
|
+
updatedOn: this.updatedOn,
|
|
53
|
+
createdBy: this.createdBy,
|
|
54
|
+
createdOn: this.createdOn,
|
|
55
|
+
pitches: this.pitches.map(function (_a) {
|
|
56
|
+
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;
|
|
57
|
+
return ({
|
|
58
|
+
turf: turf.id,
|
|
59
|
+
number: number,
|
|
60
|
+
name: name,
|
|
61
|
+
status: status,
|
|
62
|
+
sports: sports.split(",").map(function (sport) { return ({ name: sport }); }),
|
|
63
|
+
createdBy: createdBy,
|
|
64
|
+
createdOn: createdOn,
|
|
65
|
+
updatedBy: updatedBy,
|
|
66
|
+
updatedOn: updatedOn,
|
|
67
|
+
});
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
TurfModel.toMap = function (turfEntities) {
|
|
72
|
+
var response = {};
|
|
73
|
+
turfEntities.forEach(function (turfEntity) {
|
|
74
|
+
if (!response[turfEntity.id]) {
|
|
75
|
+
response[turfEntity.id] = (0, _utils_1.ConvertToCommonEntities)([
|
|
76
|
+
turfEntity.getModifiedTurfEntity(),
|
|
77
|
+
]).map(function (_a) {
|
|
78
|
+
var pitches = _a.pitches, assignToTurf = __rest(_a, ["pitches"]);
|
|
79
|
+
return (__assign(__assign({}, assignToTurf), { pitches: (0, _utils_1.ConvertToCommonEntities)(pitches) }));
|
|
80
|
+
})[0];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return response;
|
|
84
|
+
};
|
|
85
|
+
TurfModel.toKeyValue = function (turfEntities) {
|
|
86
|
+
var response = {};
|
|
87
|
+
turfEntities.forEach(function (turfEntity) {
|
|
88
|
+
if (!response[turfEntity.id]) {
|
|
89
|
+
response[turfEntity.id] = turfEntity;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return response;
|
|
93
|
+
};
|
|
94
|
+
TurfModel.fromEntity = function (data) {
|
|
95
|
+
return new TurfModel(data);
|
|
96
|
+
};
|
|
97
|
+
TurfModel.filterBySubscriptionPitchMapping = function (turfEntities, subscriptionPitchMappingEntities, pitchStatusSet) {
|
|
98
|
+
turfEntities.forEach(function (turfEntity) {
|
|
99
|
+
turfEntity.pitches = turfEntity.pitches.filter(function (pitchEntity) {
|
|
100
|
+
var subscriptionPitchMappingEntity = subscriptionPitchMappingEntities.find(function (_a) {
|
|
101
|
+
var turfId = _a.turfId, pitchId = _a.pitchId, status = _a.status;
|
|
102
|
+
return turfId === turfEntity.id &&
|
|
103
|
+
pitchId === pitchEntity.number &&
|
|
104
|
+
pitchStatusSet.has(status);
|
|
105
|
+
});
|
|
106
|
+
if (subscriptionPitchMappingEntity)
|
|
107
|
+
return true;
|
|
108
|
+
else
|
|
109
|
+
false;
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
return turfEntities;
|
|
113
|
+
};
|
|
114
|
+
return TurfModel;
|
|
115
|
+
}());
|
|
116
|
+
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
|
+
export declare class UserModel implements IUserModel {
|
|
6
|
+
id: number;
|
|
7
|
+
firstname: string;
|
|
8
|
+
phone: string;
|
|
9
|
+
password: string;
|
|
10
|
+
email: string;
|
|
11
|
+
status: UserStatus;
|
|
12
|
+
is_email_verified: boolean;
|
|
13
|
+
is_mobile_verified: boolean;
|
|
14
|
+
is_account_verified: boolean;
|
|
15
|
+
require_new_password: boolean;
|
|
16
|
+
organization_id: number;
|
|
17
|
+
type: UserType;
|
|
18
|
+
createdOn: Date;
|
|
19
|
+
updatedOn: Date;
|
|
20
|
+
createdBy: number;
|
|
21
|
+
updatedBy: number;
|
|
22
|
+
registrationId: number;
|
|
23
|
+
comments: string;
|
|
24
|
+
turf: ITurfEntity[];
|
|
25
|
+
imageUrl: string;
|
|
26
|
+
constructor(data: IUserModel);
|
|
27
|
+
static toMap<T extends {
|
|
28
|
+
id: number;
|
|
29
|
+
}>(userEntities: T[]): {
|
|
30
|
+
[key: number]: T;
|
|
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,27 @@
|
|
|
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
|
+
getPitchSlabIndex(pitchCount: number): number;
|
|
25
|
+
formatPitchSlab(index: number): string;
|
|
26
|
+
getBillingCycleIndexByMonths(noOfMonths: number): number;
|
|
27
|
+
}
|