turf-common 1.4.2-beta.45 → 1.4.2-beta.46

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.
@@ -39,6 +39,7 @@ export declare class BookingCode {
39
39
  }): number;
40
40
  isModificationAllowed(delayInMinutes?: number): boolean;
41
41
  isDeletionAllowed(delayInMinutes?: number): boolean;
42
+ isCreationAllowed(delayInMinutes?: number): boolean;
42
43
  static sortByCode(bookingCodes: BookingCode[]): void;
43
44
  static getOneSlotBookingCode(turfId: string, bookingDate: string, fhfm: string, thtm: string, pitchCode: string): string;
44
45
  static getDiscountedCost(couponCode: string, totalCost: number, validationApply?: boolean, totalBookingHours?: number): number;
@@ -121,6 +121,12 @@ var BookingCode = /** @class */ (function () {
121
121
  var currentTime = date_util_1.dateUtilService.getIndianDate();
122
122
  return bookingFromDateTimeWithDelay > currentTime;
123
123
  };
124
+ BookingCode.prototype.isCreationAllowed = function (delayInMinutes) {
125
+ if (delayInMinutes === void 0) { delayInMinutes = _utils_1.DEFAULT_BOOKING_DELAY_IN_MINUTES; }
126
+ var bookingFromDateTimeWithDelay = date_util_1.dateUtilService.addMinutesTo(date_util_1.dateUtilService.convertStringToDate(this.getDateWithFromTimeCode(), "yyMMddHHmm"), delayInMinutes);
127
+ var currentTime = date_util_1.dateUtilService.getIndianDate();
128
+ return bookingFromDateTimeWithDelay > currentTime;
129
+ };
124
130
  BookingCode.sortByCode = function (bookingCodes) {
125
131
  bookingCodes.sort(function (_a, _b) {
126
132
  var code1 = _a.code;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.4.2-beta.45",
3
+ "version": "1.4.2-beta.46",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",