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.
- package/build/enums/booking-details-status.enum.js +6 -0
- package/build/enums/booking-fetch-filter.enum.d.ts +1 -1
- package/build/enums/booking-history-operation-type.enum.d.ts +1 -1
- package/build/enums/booking-history-operation-type.enum.js +3 -3
- package/build/enums/configuration-description.enum.d.ts +1 -1
- package/build/enums/configuration-key.enum.js +3 -4
- package/build/enums/configuration-text.enum.d.ts +1 -1
- package/build/enums/cron-jobs-name.enum.d.ts +1 -1
- package/build/enums/cron-jobs-status.enum.d.ts +1 -1
- package/build/enums/faqs-status.enum.d.ts +1 -1
- package/build/enums/modification-discount-policy.enum.d.ts +1 -1
- package/build/enums/organization-status.enum.d.ts +1 -1
- package/build/enums/organization-status.enum.js +6 -5
- package/build/enums/payment-mode.enum.d.ts +1 -1
- package/build/enums/pitch-operation.enum.d.ts +1 -1
- package/build/enums/pitch-sports.enum.d.ts +1 -1
- package/build/enums/pricing-plan-status.enum.d.ts +1 -1
- package/build/enums/registration-status-enum.d.ts +1 -1
- package/build/enums/socket-io-booking-operation.enum.d.ts +1 -1
- package/build/enums/timezone.enum.d.ts +1 -1
- package/build/enums/transaction-type.enum.d.ts +1 -1
- package/build/enums/user-status.enum.d.ts +1 -1
- package/build/enums/valid-coupon-type.enum.d.ts +1 -1
- package/build/enums/valid-type.enum.d.ts +1 -1
- package/build/models/charge-model.js +4 -5
- package/build/models/entity/booking-payment-history-model.js +2 -3
- package/package.json +1 -1
|
@@ -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 = {}));
|
|
@@ -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] =
|
|
23
|
-
_a[ConfigurationKey.SUBSCRIPTION_REMINDER] =
|
|
24
|
-
_a[ConfigurationKey.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"
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
31
|
-
})(
|
|
31
|
+
OrganizationStatuss.allowPermissionOwner = allowPermissionOwner;
|
|
32
|
+
})(OrganizationStatuss || (exports.OrganizationStatuss = OrganizationStatuss = {}));
|
|
@@ -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
|
-
|
|
31
|
-
|
|
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 =
|
|
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 =
|
|
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 ===
|
|
24
|
+
if (type === "cash" /* PaymentMode.CASH */)
|
|
26
25
|
turfWisePaymentData.cashTotal += amount;
|
|
27
|
-
else if (type ===
|
|
26
|
+
else if (type === "upi" /* PaymentMode.UPI */)
|
|
28
27
|
turfWisePaymentData.upiTotal += amount;
|
|
29
28
|
turfWisePaymentData.total =
|
|
30
29
|
turfWisePaymentData.cashTotal + turfWisePaymentData.upiTotal;
|