turf-common 1.3.1-beta.3 → 1.3.1-beta.5

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.
@@ -21,11 +21,13 @@ export interface IGetBookingById extends Omit<IBookingDetailsEntity, "createdBy"
21
21
  };
22
22
  email: string;
23
23
  bookings: {
24
- [date: string]: {
25
- [timeCode: string]: {
26
- cost: string;
27
- code: string;
28
- extentDay: number;
24
+ [pitchId: string]: {
25
+ [date: string]: {
26
+ [timeCode: string]: {
27
+ cost: string;
28
+ code: string;
29
+ extendedDays: number;
30
+ };
29
31
  };
30
32
  };
31
33
  };
@@ -126,4 +126,5 @@ export declare class BookingCode {
126
126
  * @returns {BookingCode[]} An array containing BookingCode models.
127
127
  */
128
128
  getBookingCodeModelsByAcrossDateBookingCode(): BookingCode[];
129
+ isAdjacentBookingCode(nextBookingCode: BookingCode): boolean;
129
130
  }
@@ -591,6 +591,14 @@ var BookingCode = /** @class */ (function () {
591
591
  });
592
592
  return bookingCodeModels;
593
593
  };
594
+ BookingCode.prototype.isAdjacentBookingCode = function (nextBookingCode) {
595
+ return (this.toTimeCode === _utils_1.END_OF_DAY_TIME_CODE &&
596
+ nextBookingCode.fromTimeCode === _utils_1.START_OF_DAY_TIME_CODE &&
597
+ date_util_1.dateUtilService.addNDaysToDateCode(this.dateCode, 1) ===
598
+ nextBookingCode.dateCode &&
599
+ this.pitchNumber === nextBookingCode.pitchNumber &&
600
+ this.turfId === nextBookingCode.turfId);
601
+ };
594
602
  /**
595
603
  * Extracts the numeric part of a bookingCode, excluding a predefined deleted slot separator.
596
604
  *
@@ -1,3 +1,5 @@
1
1
  export declare const SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = 7;
2
2
  export declare const DEFAULT_PASSWORD = "turf@#123";
3
3
  export declare const DELETED_SLOT_SEPARATOR = "d_";
4
+ export declare const START_OF_DAY_TIME_CODE = "0000";
5
+ export declare const END_OF_DAY_TIME_CODE = "2400";
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DELETED_SLOT_SEPARATOR = exports.DEFAULT_PASSWORD = exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = void 0;
3
+ exports.END_OF_DAY_TIME_CODE = exports.START_OF_DAY_TIME_CODE = 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
6
  exports.DELETED_SLOT_SEPARATOR = "d_";
7
+ exports.START_OF_DAY_TIME_CODE = "0000";
8
+ exports.END_OF_DAY_TIME_CODE = "2400";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.3.1-beta.3",
3
+ "version": "1.3.1-beta.5",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",