turf-common 1.2.1-beta.66 → 1.2.1-beta.68
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/entity/booking-history-entity.interface.d.ts +4 -0
- package/build/models/booking-code-model.d.ts +7 -0
- package/build/models/booking-code-model.js +11 -0
- package/build/models/turf-availability-model.js +2 -2
- package/build/utils/constant.d.ts +1 -0
- package/build/utils/constant.js +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BookingDetailsStatus } from "../../@enum";
|
|
1
2
|
import { BookingHistoryOperationType } from "../../enums/booking-history-operation-type.enum";
|
|
2
3
|
import { PaymentMode } from "../../enums/payment-mode.enum";
|
|
3
4
|
import { IEntityAuditColumn } from "./entity-audit-column.interface";
|
|
@@ -28,4 +29,7 @@ export interface IBookingHistoryEntity extends IEntityAuditColumn {
|
|
|
28
29
|
amountPayable: number;
|
|
29
30
|
refundPayable: number;
|
|
30
31
|
totalRefundedAmount: number;
|
|
32
|
+
type: string | null;
|
|
33
|
+
totalBookingHours: number;
|
|
34
|
+
status: BookingDetailsStatus;
|
|
31
35
|
}
|
|
@@ -70,6 +70,13 @@ export declare class BookingCode {
|
|
|
70
70
|
}): string;
|
|
71
71
|
static padBookingCode(bookingCodeWithoutTurfCode: string): string;
|
|
72
72
|
static getInstance(turfId: number, bookingCodeWithoutTurfCode: string): BookingCode;
|
|
73
|
+
/**
|
|
74
|
+
* Extracts the numeric part of a bookingCode, excluding a predefined deleted slot separator.
|
|
75
|
+
*
|
|
76
|
+
* @param {string} bookingCode - The input bookingCode to extract from.
|
|
77
|
+
* @returns {string} The numeric part of the bookingCode.
|
|
78
|
+
*/
|
|
79
|
+
static extractBookingCodeByDeletedSlotSeparator: (bookingCode: string) => string;
|
|
73
80
|
getCost(): number;
|
|
74
81
|
getTimeslot(): TimeSlot;
|
|
75
82
|
static getIndianTimeZoneDate(bookingBufferOffsetHour?: number): Date;
|
|
@@ -556,6 +556,17 @@ var BookingCode = /** @class */ (function () {
|
|
|
556
556
|
});
|
|
557
557
|
return totalBookingHours;
|
|
558
558
|
};
|
|
559
|
+
/**
|
|
560
|
+
* Extracts the numeric part of a bookingCode, excluding a predefined deleted slot separator.
|
|
561
|
+
*
|
|
562
|
+
* @param {string} bookingCode - The input bookingCode to extract from.
|
|
563
|
+
* @returns {string} The numeric part of the bookingCode.
|
|
564
|
+
*/
|
|
565
|
+
BookingCode.extractBookingCodeByDeletedSlotSeparator = function (bookingCode) {
|
|
566
|
+
return bookingCode.startsWith(_utils_1.DELETED_SLOT_SEPARATOR)
|
|
567
|
+
? bookingCode.slice(_utils_1.DELETED_SLOT_SEPARATOR.length)
|
|
568
|
+
: bookingCode;
|
|
569
|
+
};
|
|
559
570
|
return BookingCode;
|
|
560
571
|
}());
|
|
561
572
|
exports.BookingCode = BookingCode;
|
|
@@ -179,10 +179,10 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
179
179
|
return "event#".concat(this.dateCodes[0]).concat(this.dateCodes[this.dateCodes.length - 1], "#").concat(this.timeSlotCodesDateWise[this.dateCodes[0]][0].slice(0, 4)).concat(this.timeSlotCodesDateWise[this.dateCodes[0]][this.timeSlotCodesDateWise[this.dateCodes[0]].length - 1].slice(4, 8), "#").concat(this.getPitchIds(), "#").concat(this.weekDays);
|
|
180
180
|
};
|
|
181
181
|
TurfAvailability.prototype.parse = function () {
|
|
182
|
+
if (!Object.keys(this.data).length)
|
|
183
|
+
return;
|
|
182
184
|
var eventCode = this.getCode();
|
|
183
185
|
var eventCodes = eventCode.split("#");
|
|
184
|
-
if (!eventCodes.length)
|
|
185
|
-
return;
|
|
186
186
|
var dateCodeRange = eventCodes[1];
|
|
187
187
|
var timeCodeRange = eventCodes[2];
|
|
188
188
|
this.pitchCodes = eventCodes[3].split(",").map(function (id) { return id.padStart(2, "0"); });
|
package/build/utils/constant.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_PASSWORD = exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = void 0;
|
|
3
|
+
exports.DELETED_SLOT_SEPARATOR = exports.DEFAULT_PASSWORD = exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = void 0;
|
|
4
4
|
exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = 7;
|
|
5
5
|
exports.DEFAULT_PASSWORD = "turf@#123";
|
|
6
|
+
exports.DELETED_SLOT_SEPARATOR = "d_";
|