turf-common 1.1.1-beta.34 → 1.1.1-beta.37

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.
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BookingDetailsStatus = void 0;
4
+ var BookingDetailsStatus;
5
+ (function (BookingDetailsStatus) {
6
+ BookingDetailsStatus["BOOKED"] = "booked";
7
+ BookingDetailsStatus["BLOCKED"] = "blocked";
8
+ })(BookingDetailsStatus || (exports.BookingDetailsStatus = BookingDetailsStatus = {}));
@@ -1,4 +1,4 @@
1
- export declare enum BookingFetchFilter {
1
+ export declare const enum BookingFetchFilter {
2
2
  PENDING_PAYMENT = "pending_payment",
3
3
  PENDING_REFUND = "pending_refund",
4
4
  FULL_REFUND = "full_refund"
@@ -1,4 +1,4 @@
1
- export declare enum BookingHistoryOperationType {
1
+ export declare const enum BookingHistoryOperationType {
2
2
  DELETE = "delete",
3
3
  UPDATE = "update",
4
4
  INSERT = "insert",
@@ -12,7 +12,7 @@ var BookingHistoryOperationType;
12
12
  BookingHistoryOperationType["PAYMENT"] = "payment";
13
13
  })(BookingHistoryOperationType || (exports.BookingHistoryOperationType = BookingHistoryOperationType = {}));
14
14
  exports.operationTypes = [
15
- BookingHistoryOperationType.DELETE,
16
- BookingHistoryOperationType.REFUND,
17
- BookingHistoryOperationType.PAYMENT,
15
+ "delete" /* BookingHistoryOperationType.DELETE */,
16
+ "refund" /* BookingHistoryOperationType.REFUND */,
17
+ "payment" /* BookingHistoryOperationType.PAYMENT */,
18
18
  ];
@@ -1,4 +1,4 @@
1
- export declare enum ConfigurationDescription {
1
+ export declare const enum ConfigurationDescription {
2
2
  SEND_DAILY_COLLECTION = "Daily payment collection will be sent by email to the owner",
3
3
  SUBSCRIPTION_REMINDER = "Send reminder to owners",
4
4
  SUBSCRIPTION_ACTIVATION = "subscription_activation"
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConfigurationKey = void 0;
4
- var cron_jobs_name_enum_1 = require("./cron-jobs-name.enum");
5
4
  var ConfigurationKey;
6
5
  (function (ConfigurationKey) {
7
6
  ConfigurationKey["SEND_DAILY_COLLECTION"] = "send_daily_collection";
@@ -19,9 +18,9 @@ var ConfigurationKey;
19
18
  function getCronJobName(configurationKey) {
20
19
  var _a;
21
20
  var cronJobConfigurationKeyMapping = (_a = {},
22
- _a[ConfigurationKey.SEND_DAILY_COLLECTION] = cron_jobs_name_enum_1.CronJobsNames.SEND_DAILY_COLLECTION,
23
- _a[ConfigurationKey.SUBSCRIPTION_REMINDER] = cron_jobs_name_enum_1.CronJobsNames.SUBSCRIPTION_REMINDER,
24
- _a[ConfigurationKey.SUBSCRIPTION_ACTIVATION] = cron_jobs_name_enum_1.CronJobsNames.SUBSCRIPTION_ACTIVATION,
21
+ _a[ConfigurationKey.SEND_DAILY_COLLECTION] = "send_daily_collection" /* CronJobsNames.SEND_DAILY_COLLECTION */,
22
+ _a[ConfigurationKey.SUBSCRIPTION_REMINDER] = "subscription_reminder" /* CronJobsNames.SUBSCRIPTION_REMINDER */,
23
+ _a[ConfigurationKey.SUBSCRIPTION_ACTIVATION] = "subscription_activation" /* CronJobsNames.SUBSCRIPTION_ACTIVATION */,
25
24
  _a);
26
25
  return cronJobConfigurationKeyMapping[configurationKey];
27
26
  }
@@ -1,4 +1,4 @@
1
- export declare enum ConfigurationText {
1
+ export declare const enum ConfigurationText {
2
2
  SEND_DAILY_COLLECTION = "A daily payment collection email will be sent to the owner",
3
3
  SUBSCRIPTION_REMINDER = "Send reminder to owners on specific days",
4
4
  SUBSCRIPTION_ACTIVATION = "subscription_activation"
@@ -1,4 +1,4 @@
1
- export declare enum CronJobsNames {
1
+ export declare const enum CronJobsNames {
2
2
  SEND_DAILY_COLLECTION = "send_daily_collection",
3
3
  SUBSCRIPTION_REMINDER = "subscription_reminder",
4
4
  SUBSCRIPTION_ACTIVATION = "subscription_activation"
@@ -1,4 +1,4 @@
1
- export declare enum CronJobsStatus {
1
+ export declare const enum CronJobsStatus {
2
2
  RUNNING = "running",
3
3
  FAILED = "failed",
4
4
  SUCCESS = "success"
@@ -1,3 +1,3 @@
1
- export declare enum FaqsStatus {
1
+ export declare const enum FaqsStatus {
2
2
  ACTIVE = "active"
3
3
  }
@@ -1,4 +1,4 @@
1
- export declare enum ModificationDiscountPolicy {
1
+ export declare const enum ModificationDiscountPolicy {
2
2
  DISCOUNT_RECALL = "discount_recall",
3
3
  DISCOUNT_RELATIVE = "discount_relative",
4
4
  DISCOUNT_CONDITIONAL = "discount_conditional"
@@ -9,7 +9,7 @@ export declare enum OrganizationStatus {
9
9
  ACCOUNT_ACTIVE = "account_active",
10
10
  ACCOUNT_SUSPENDED = "account_suspended"
11
11
  }
12
- export declare namespace OrganizationStatus {
12
+ export declare namespace OrganizationStatuss {
13
13
  function allowPermissionSuperAdmin(): OrganizationStatus[];
14
14
  function allowPermissionOwner(): OrganizationStatus[];
15
15
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrganizationStatus = void 0;
3
+ exports.OrganizationStatuss = exports.OrganizationStatus = void 0;
4
4
  var OrganizationStatus;
5
5
  (function (OrganizationStatus) {
6
6
  OrganizationStatus["REGISTRATION"] = "registration";
@@ -14,18 +14,19 @@ var OrganizationStatus;
14
14
  OrganizationStatus["ACCOUNT_SUSPENDED"] = "account_suspended";
15
15
  })(OrganizationStatus || (exports.OrganizationStatus = OrganizationStatus = {}));
16
16
  // eslint-disable-next-line @typescript-eslint/no-namespace
17
- (function (OrganizationStatus) {
17
+ var OrganizationStatuss;
18
+ (function (OrganizationStatuss) {
18
19
  function allowPermissionSuperAdmin() {
19
20
  return Object.values(OrganizationStatus).filter(function (status) {
20
21
  return status !== OrganizationStatus.SETUP_DONE &&
21
22
  status !== OrganizationStatus.REGISTRATION;
22
23
  });
23
24
  }
24
- OrganizationStatus.allowPermissionSuperAdmin = allowPermissionSuperAdmin;
25
+ OrganizationStatuss.allowPermissionSuperAdmin = allowPermissionSuperAdmin;
25
26
  function allowPermissionOwner() {
26
27
  return Object.values(OrganizationStatus).filter(function (status) {
27
28
  return status === OrganizationStatus.SETUP_DONE;
28
29
  });
29
30
  }
30
- OrganizationStatus.allowPermissionOwner = allowPermissionOwner;
31
- })(OrganizationStatus || (exports.OrganizationStatus = OrganizationStatus = {}));
31
+ OrganizationStatuss.allowPermissionOwner = allowPermissionOwner;
32
+ })(OrganizationStatuss || (exports.OrganizationStatuss = OrganizationStatuss = {}));
@@ -1,4 +1,4 @@
1
- export declare enum PaymentMode {
1
+ export declare const enum PaymentMode {
2
2
  UPI = "upi",
3
3
  CASH = "cash"
4
4
  }
@@ -1,4 +1,4 @@
1
- export declare enum PitchOperations {
1
+ export declare const enum PitchOperations {
2
2
  DELETE = "delete",
3
3
  UPDATE = "update",
4
4
  CREATE = "create"
@@ -1,4 +1,4 @@
1
- export declare enum PitchSports {
1
+ export declare const enum PitchSports {
2
2
  CRICKET = "cricket",
3
3
  FOOTBALL = "football",
4
4
  HOCKEY = "hockey",
@@ -1,4 +1,4 @@
1
- export declare enum PricingPlanStatus {
1
+ export declare const enum PricingPlanStatus {
2
2
  ACTIVE = "active",
3
3
  DEACTIVE = "deactive"
4
4
  }
@@ -1,4 +1,4 @@
1
- export declare enum RegistrationStatus {
1
+ export declare const enum RegistrationStatus {
2
2
  REGISTRATION = "registration",
3
3
  REGISTRATION_INVALID = "registration_invalid",
4
4
  REGISTRATION_APPROVED = "registration_approved",
@@ -1,4 +1,4 @@
1
- export declare enum BookingOperations {
1
+ export declare const enum BookingOperations {
2
2
  BOOKED = "booked",
3
3
  BLOCKED = "blocked",
4
4
  DELETE = "delete",
@@ -1,3 +1,3 @@
1
- export declare enum Timezone {
1
+ export declare const enum Timezone {
2
2
  ASIA_KOLKATA = "Asia/Kolkata"
3
3
  }
@@ -1,4 +1,4 @@
1
- export declare enum BookingPaymentTransactionType {
1
+ export declare const enum BookingPaymentTransactionType {
2
2
  CUSTOMER_PAYMENT = "customer_payment",
3
3
  CUSTOMER_REFUND = "customer_refund",
4
4
  CUSTOMER_REFUND_INPROCESS = "customer_refund_inprocess",
@@ -1,4 +1,4 @@
1
- export declare enum UserStatus {
1
+ export declare const enum UserStatus {
2
2
  ACTIVE = "active",
3
3
  DEACTIVE = "deactive",
4
4
  SUSPENDED = "suspended",
@@ -1,4 +1,4 @@
1
- export declare enum ValidCouponType {
1
+ export declare const enum ValidCouponType {
2
2
  PERCENTAGE = "percentage",
3
3
  UNIT = "unit"
4
4
  }
@@ -1,4 +1,4 @@
1
- export declare enum UserType {
1
+ export declare const enum UserType {
2
2
  STAFF = "staff",
3
3
  OWNER = "owner",
4
4
  SUPERADMIN = "superadmin",
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChargesModel = void 0;
4
4
  var app_badrequest_exception_1 = require("../exceptions/app-badrequest.exception");
5
- var modification_discount_policy_enum_1 = require("../enums/modification-discount-policy.enum");
6
5
  var ChargesModel = /** @class */ (function () {
7
6
  function ChargesModel(initialGrossAmount, paidAmount, couponCode, discountPolicy) {
8
7
  this.initialBookingGrossAmount = initialGrossAmount;
@@ -27,8 +26,8 @@ var ChargesModel = /** @class */ (function () {
27
26
  };
28
27
  ChargesModel.prototype.getDiscountAmount = function () {
29
28
  if ([
30
- modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL,
31
- modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_RECALL,
29
+ "discount_conditional" /* ModificationDiscountPolicy.DISCOUNT_CONDITIONAL */,
30
+ "discount_recall" /* ModificationDiscountPolicy.DISCOUNT_RECALL */,
32
31
  ].includes(this.discountPolicy) &&
33
32
  this.cancelledBookingGrossAmount > 0) {
34
33
  this.couponCode = "";
@@ -186,13 +185,13 @@ var ChargesModel = /** @class */ (function () {
186
185
  return newChargeModel;
187
186
  };
188
187
  ChargesModel.getInstanceByInterface = function (bookingDetailsEntity, discountPolicy) {
189
- if (discountPolicy === void 0) { discountPolicy = modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL; }
188
+ if (discountPolicy === void 0) { discountPolicy = "discount_conditional" /* ModificationDiscountPolicy.DISCOUNT_CONDITIONAL */; }
190
189
  var chargesModel = new ChargesModel(bookingDetailsEntity.initialBookingGrossAmount, bookingDetailsEntity.amountPaid, bookingDetailsEntity.couponCode, discountPolicy);
191
190
  Object.assign(chargesModel, bookingDetailsEntity);
192
191
  return chargesModel;
193
192
  };
194
193
  ChargesModel.assignByInterface = function (bookingDetailsEntity, discountPolicy) {
195
- if (discountPolicy === void 0) { discountPolicy = modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL; }
194
+ if (discountPolicy === void 0) { discountPolicy = "discount_conditional" /* ModificationDiscountPolicy.DISCOUNT_CONDITIONAL */; }
196
195
  var newChargeModel = new ChargesModel(bookingDetailsEntity.initialBookingGrossAmount, bookingDetailsEntity.amountPaid, bookingDetailsEntity.couponCode, discountPolicy);
197
196
  newChargeModel.additionalBookingGrossAmount =
198
197
  bookingDetailsEntity.additionalBookingGrossAmount;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BookingPaymentHistoryModel = void 0;
4
- var payment_mode_enum_1 = require("../../enums/payment-mode.enum");
5
4
  var booking_code_model_1 = require("../booking-code-model");
6
5
  var BookingPaymentHistoryModel = /** @class */ (function () {
7
6
  function BookingPaymentHistoryModel(data) {
@@ -22,9 +21,9 @@ var BookingPaymentHistoryModel = /** @class */ (function () {
22
21
  upiTotal: 0,
23
22
  total: 0,
24
23
  };
25
- if (type === payment_mode_enum_1.PaymentMode.CASH)
24
+ if (type === "cash" /* PaymentMode.CASH */)
26
25
  turfWisePaymentData.cashTotal += amount;
27
- else if (type === payment_mode_enum_1.PaymentMode.UPI)
26
+ else if (type === "upi" /* PaymentMode.UPI */)
28
27
  turfWisePaymentData.upiTotal += amount;
29
28
  turfWisePaymentData.total =
30
29
  turfWisePaymentData.cashTotal + turfWisePaymentData.upiTotal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.1.1-beta.34",
3
+ "version": "1.1.1-beta.37",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",