turf-common 1.4.2-beta.8 → 2.0.0

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.
Files changed (64) hide show
  1. package/README.md +20 -20
  2. package/build/jest.config.js +2 -1
  3. package/build/src/@model.d.ts +1 -0
  4. package/build/src/@model.js +1 -0
  5. package/build/src/enums/booking-history-operation-type.enum.d.ts +4 -1
  6. package/build/src/enums/booking-history-operation-type.enum.js +3 -0
  7. package/build/src/enums/organization-status.enum.d.ts +4 -0
  8. package/build/src/enums/organization-status.enum.js +6 -1
  9. package/build/src/enums/transaction-type.enum.d.ts +2 -1
  10. package/build/src/enums/transaction-type.enum.js +1 -0
  11. package/build/src/interface/api/booking-availablity-by-pitch.interface.d.ts +1 -0
  12. package/build/src/interface/api/booking-pending-payment-writeoff.interface.d.ts +10 -0
  13. package/build/src/interface/api/booking-pending-payment-writeoff.interface.js +2 -0
  14. package/build/src/interface/api/create-recurring-slot-booking.interface.d.ts +4 -1
  15. package/build/src/interface/api/create-user.interface.d.ts +1 -1
  16. package/build/src/interface/api/get-availability-by-turf.interface.d.ts +1 -0
  17. package/build/src/interface/api/get-booking-by-organization-id.interface.d.ts +1 -1
  18. package/build/src/interface/api/get-booking-history.interface.d.ts +1 -0
  19. package/build/src/interface/api/get-collection.interface.d.ts +1 -1
  20. package/build/src/interface/api/get-organization-configuration.interface.d.ts +8 -0
  21. package/build/src/interface/api/get-organization-configuration.interface.js +2 -0
  22. package/build/src/interface/api/index.d.ts +3 -0
  23. package/build/src/interface/api/index.js +3 -0
  24. package/build/src/interface/api/login-response.interface.d.ts +4 -1
  25. package/build/src/interface/api/one-slot-booking.interface.d.ts +2 -0
  26. package/build/src/interface/api/staff-member-list.interface.d.ts +1 -1
  27. package/build/src/interface/api/update-organization-configuration.interface.d.ts +6 -0
  28. package/build/src/interface/api/update-organization-configuration.interface.js +2 -0
  29. package/build/src/interface/api/update-recurring-booking.interface.d.ts +1 -0
  30. package/build/src/interface/api/update-staff-member.interface.d.ts +1 -1
  31. package/build/src/interface/entity/organization-entity.interface.d.ts +15 -3
  32. package/build/src/interface/entity/user-entity.interface.d.ts +6 -6
  33. package/build/src/interface/get-booking-by-id.interface.d.ts +2 -2
  34. package/build/src/interface/model/booking-details-model.interface.d.ts +8 -0
  35. package/build/src/interface/user-entity-essential-info.interface.d.ts +1 -1
  36. package/build/src/models/booking-code-model.d.ts +16 -2
  37. package/build/src/models/booking-code-model.js +83 -40
  38. package/build/src/models/charge-model.d.ts +2 -0
  39. package/build/src/models/charge-model.js +41 -11
  40. package/build/src/models/entity/booking-details-model.d.ts +2 -1
  41. package/build/src/models/entity/booking-details-model.js +19 -0
  42. package/build/src/models/entity/booking-entity-model.d.ts +1 -0
  43. package/build/src/models/entity/booking-entity-model.js +3 -0
  44. package/build/src/models/entity/user-model.d.ts +6 -6
  45. package/build/src/models/time-slot-model.d.ts +1 -0
  46. package/build/src/models/time-slot-model.js +3 -0
  47. package/build/src/models/turf-availability-model.d.ts +18 -3
  48. package/build/src/models/turf-availability-model.js +60 -3
  49. package/build/src/models/weekday-time-slot-model.d.ts +12 -0
  50. package/build/src/models/weekday-time-slot-model.js +30 -0
  51. package/build/src/utils/constant.d.ts +3 -0
  52. package/build/src/utils/constant.js +4 -1
  53. package/build/src/utils/date-util.d.ts +8 -1
  54. package/build/src/utils/date-util.js +22 -3
  55. package/build/tests/booking-code/method.spec.d.ts +1 -0
  56. package/build/tests/booking-code/method.spec.js +11 -0
  57. package/build/tests/unit/charges/discount-relative/basic.spec.d.ts +1 -0
  58. package/build/tests/unit/charges/discount-relative/basic.spec.js +209 -0
  59. package/build/tests/unit/charges/extension/basic.amount-fully-paid.spec.d.ts +1 -0
  60. package/build/tests/unit/charges/extension/basic.amount-fully-paid.spec.js +208 -0
  61. package/build/tests/unit/charges/extension/basic.spec.d.ts +1 -0
  62. package/build/tests/unit/charges/extension/basic.spec.js +215 -0
  63. package/build/tests/unit/pricing-plan/basic-scenario.spec.js +1 -1
  64. package/package.json +17 -6
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
- ## 1 npm init -y
2
-
3
- ## 2 npm login
4
-
5
- ## 3 npm version patch
6
-
7
- # //it increase version
8
-
9
- ## 3 npm publish --access public
10
-
11
- # //npm publish by default --access public
12
-
13
- ## 4 npm run version:deploy
14
-
15
- ### deploy version
16
-
17
- ## Client side
18
-
19
- update package command <br />
20
- npm update turf-comman
1
+ ## 1 npm init -y
2
+
3
+ ## 2 npm login
4
+
5
+ ## 3 npm version patch
6
+
7
+ # //it increase version
8
+
9
+ ## 3 npm publish --access public
10
+
11
+ # //npm publish by default --access public
12
+
13
+ ## 4 npm run version:deploy
14
+
15
+ ### deploy version
16
+
17
+ ## Client side
18
+
19
+ update package command <br />
20
+ npm update turf-comman
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // Sync object
4
4
  var config = {
5
- verbose: true,
5
+ // verbose: true,
6
6
  transform: {
7
7
  "^.+\\.tsx?$": "ts-jest",
8
8
  },
9
+ testMatch: ["**/tests/**/*.spec.ts"],
9
10
  };
10
11
  exports.default = config;
@@ -7,3 +7,4 @@ export * from "./models/pricing-plan-model";
7
7
  export * from "./models/subscribed-pricing-plan-model";
8
8
  export * from "./models/entity";
9
9
  export * from "./models/turf-availability-model";
10
+ export * from "./models/weekday-time-slot-model";
@@ -23,3 +23,4 @@ __exportStar(require("./models/pricing-plan-model"), exports);
23
23
  __exportStar(require("./models/subscribed-pricing-plan-model"), exports);
24
24
  __exportStar(require("./models/entity"), exports);
25
25
  __exportStar(require("./models/turf-availability-model"), exports);
26
+ __exportStar(require("./models/weekday-time-slot-model"), exports);
@@ -7,6 +7,9 @@ export declare enum BookingHistoryOperationType {
7
7
  REFUND = "refund",
8
8
  PAYMENT = "payment",
9
9
  MERGED = "merged",
10
- DELETE_SLOT_EVENT = "delete_slot_event"
10
+ DELETE_SLOT_EVENT = "delete_slot_event",
11
+ EXTENSION = "extension",
12
+ PAYMENT_WRITEOFF = "payment_writeoff",
13
+ EXTENSION_MERGED = "extension_merged"
11
14
  }
12
15
  export declare const OPERATION_TYPES: BookingHistoryOperationType[];
@@ -12,6 +12,9 @@ var BookingHistoryOperationType;
12
12
  BookingHistoryOperationType["PAYMENT"] = "payment";
13
13
  BookingHistoryOperationType["MERGED"] = "merged";
14
14
  BookingHistoryOperationType["DELETE_SLOT_EVENT"] = "delete_slot_event";
15
+ BookingHistoryOperationType["EXTENSION"] = "extension";
16
+ BookingHistoryOperationType["PAYMENT_WRITEOFF"] = "payment_writeoff";
17
+ BookingHistoryOperationType["EXTENSION_MERGED"] = "extension_merged";
15
18
  })(BookingHistoryOperationType || (exports.BookingHistoryOperationType = BookingHistoryOperationType = {}));
16
19
  exports.OPERATION_TYPES = [
17
20
  BookingHistoryOperationType.DELETE,
@@ -13,3 +13,7 @@ export declare namespace OrganizationStatus {
13
13
  function allowPermissionSuperAdmin(): OrganizationStatus[];
14
14
  function allowPermissionOwner(): OrganizationStatus[];
15
15
  }
16
+ export declare enum AllowManualBookingDiscount {
17
+ YES = "yes",
18
+ NO = "no"
19
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrganizationStatus = void 0;
3
+ exports.AllowManualBookingDiscount = exports.OrganizationStatus = void 0;
4
4
  var OrganizationStatus;
5
5
  (function (OrganizationStatus) {
6
6
  OrganizationStatus["REGISTRATION"] = "registration";
@@ -29,3 +29,8 @@ var OrganizationStatus;
29
29
  }
30
30
  OrganizationStatus.allowPermissionOwner = allowPermissionOwner;
31
31
  })(OrganizationStatus || (exports.OrganizationStatus = OrganizationStatus = {}));
32
+ var AllowManualBookingDiscount;
33
+ (function (AllowManualBookingDiscount) {
34
+ AllowManualBookingDiscount["YES"] = "yes";
35
+ AllowManualBookingDiscount["NO"] = "no";
36
+ })(AllowManualBookingDiscount || (exports.AllowManualBookingDiscount = AllowManualBookingDiscount = {}));
@@ -3,5 +3,6 @@ export declare enum BookingPaymentTransactionType {
3
3
  CUSTOMER_REFUND = "customer_refund",
4
4
  CUSTOMER_REFUND_INPROCESS = "customer_refund_inprocess",
5
5
  CUSTOMER_REFUND_REJECT = "customer_refund_reject",
6
- CUSTOMER_CANCELLATION = "customer_cancellation"
6
+ CUSTOMER_CANCELLATION = "customer_cancellation",
7
+ PAYMENT_WRITEOFF = "payment_writeoff"
7
8
  }
@@ -8,4 +8,5 @@ var BookingPaymentTransactionType;
8
8
  BookingPaymentTransactionType["CUSTOMER_REFUND_INPROCESS"] = "customer_refund_inprocess";
9
9
  BookingPaymentTransactionType["CUSTOMER_REFUND_REJECT"] = "customer_refund_reject";
10
10
  BookingPaymentTransactionType["CUSTOMER_CANCELLATION"] = "customer_cancellation";
11
+ BookingPaymentTransactionType["PAYMENT_WRITEOFF"] = "payment_writeoff";
11
12
  })(BookingPaymentTransactionType || (exports.BookingPaymentTransactionType = BookingPaymentTransactionType = {}));
@@ -36,4 +36,5 @@ export interface IBookingAvailabilitySlotRequest {
36
36
  weekdays: number[];
37
37
  from: string;
38
38
  to: string;
39
+ pitchNo: number;
39
40
  }
@@ -0,0 +1,10 @@
1
+ export interface BookingPendingPaymentWriteoffRequest {
2
+ bookingDetailIds: number[];
3
+ totalWriteoffAmount: number;
4
+ remark: string;
5
+ }
6
+ export interface BookingPendingPaymentWriteoffResponse {
7
+ bookingDetailIds: number[];
8
+ totalWriteoffAmount: number;
9
+ remark: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import { PaymentMode, BookingDetailsStatus } from "../../@enum";
2
- import { IBookingDetailsEntity, IGetAvailabilityByTurf, IModifyEntity } from "../../@type";
2
+ import { IBookingDetailsEntity, IGetAvailabilityByTurf, IGetAvailabilityByTurfRequest, IModifyEntity } from "../../@type";
3
3
  export interface ICreateRecurringSlotBookingResponse extends IModifyEntity<IBookingDetailsEntity> {
4
4
  }
5
5
  export interface ICreateRecurringSlotsBookingDetailsRequest {
@@ -18,7 +18,9 @@ export interface ICreateRecurringSlotsBookingDetailsRequest {
18
18
  slot: IRecurringSlot[];
19
19
  turf_slot?: {
20
20
  availability_details: IGetAvailabilityByTurf;
21
+ apiRequestModel?: IGetAvailabilityByTurfRequest;
21
22
  };
23
+ deleteIntermediateBookings: boolean;
22
24
  }
23
25
  export declare class IRecurringSlot {
24
26
  fromDate: number;
@@ -26,4 +28,5 @@ export declare class IRecurringSlot {
26
28
  weekdays: number[];
27
29
  from: string;
28
30
  to: string;
31
+ pitchNo: number;
29
32
  }
@@ -1,6 +1,6 @@
1
1
  import { UserType } from "../../@enum";
2
2
  export interface IUserRequest {
3
- firstname: string;
3
+ name: string;
4
4
  password: string;
5
5
  phone: number;
6
6
  email?: string;
@@ -6,6 +6,7 @@ export interface IGetAvailabilityByTurfRequest {
6
6
  pitch: string;
7
7
  view: AvailabilityView;
8
8
  weekDays: number[];
9
+ weekdayTimeSlots: string[];
9
10
  }
10
11
  export interface IGetAvailabilityByTurf {
11
12
  [dateCode: string]: IAvailabilityData;
@@ -19,7 +19,7 @@ export interface IGetBookingsByOrganizationIdResponse {
19
19
  user: {
20
20
  [userId: string]: {
21
21
  id: number;
22
- firstname: string;
22
+ name: string;
23
23
  email: string;
24
24
  type: UserType;
25
25
  };
@@ -1,4 +1,5 @@
1
1
  import { IBookingHistoryEntity } from "../entity";
2
2
  export interface IGetBookingHistoryResponse extends IBookingHistoryEntity {
3
3
  text: string;
4
+ createdByUsername: string;
4
5
  }
@@ -8,7 +8,7 @@ export interface IGetCollectionResponse {
8
8
  }>;
9
9
  };
10
10
  users: {
11
- [key: number]: Pick<IUserEntity, "id" | "firstname" | "phone" | "email" | "type">;
11
+ [key: number]: Pick<IUserEntity, "id" | "name" | "phone" | "email" | "type">;
12
12
  };
13
13
  total: IDateWisePaymentHistoryData;
14
14
  payments: Modify<IBookingPaymentHistoryEntity, {
@@ -0,0 +1,8 @@
1
+ export interface IGetOrganizationConfigurationResponse {
2
+ [key: string]: {
3
+ key: string;
4
+ value: string;
5
+ text: string;
6
+ description: string;
7
+ };
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -76,3 +76,6 @@ export * from "../api/update-sports-interface";
76
76
  export * from "./get-availability-by-turf.interface";
77
77
  export * from "./get-tournament.interface";
78
78
  export * from "./get-booking-history.interface";
79
+ export * from "./booking-pending-payment-writeoff.interface";
80
+ export * from "./get-organization-configuration.interface";
81
+ export * from "./update-organization-configuration.interface";
@@ -94,3 +94,6 @@ __exportStar(require("../api/update-sports-interface"), exports);
94
94
  __exportStar(require("./get-availability-by-turf.interface"), exports);
95
95
  __exportStar(require("./get-tournament.interface"), exports);
96
96
  __exportStar(require("./get-booking-history.interface"), exports);
97
+ __exportStar(require("./booking-pending-payment-writeoff.interface"), exports);
98
+ __exportStar(require("./get-organization-configuration.interface"), exports);
99
+ __exportStar(require("./update-organization-configuration.interface"), exports);
@@ -1,9 +1,10 @@
1
+ import { IOrganizationConfig } from "../entity";
1
2
  export interface ILoginResponse {
2
3
  UIMessage: string;
3
4
  tokenType: string;
4
5
  accessToken: string;
5
6
  id: string;
6
- firstname: string;
7
+ name: string;
7
8
  status: string;
8
9
  requireNewPassword: boolean;
9
10
  userId: number;
@@ -15,6 +16,8 @@ export interface ILoginResponse {
15
16
  organizationId: number;
16
17
  subscriptionStatus: string | null;
17
18
  contact: string;
19
+ orgConfig: IOrganizationConfig;
20
+ registrationFlowVersion?: number | null;
18
21
  }
19
22
  export interface ILoginRequest {
20
23
  username: string;
@@ -12,6 +12,7 @@ export interface ICreateOneSlotBookingDetailsRequest {
12
12
  discountedCost: number;
13
13
  amountPaid: number;
14
14
  pitchId: number;
15
+ pitchIds?: number[];
15
16
  status: BookingDetailsStatus;
16
17
  sport: string;
17
18
  remarks?: string | null;
@@ -21,4 +22,5 @@ export interface ICreateOneSlot {
21
22
  date: number;
22
23
  from: string;
23
24
  to: string;
25
+ pitchNo: number;
24
26
  }
@@ -1,7 +1,7 @@
1
1
  import { UserStatus } from "../../@enum";
2
2
  export interface IStaffMemberListResponse {
3
3
  id: number;
4
- firstname: string;
4
+ name: string;
5
5
  phone: string;
6
6
  email: string;
7
7
  status: UserStatus;
@@ -0,0 +1,6 @@
1
+ export interface IUpdateOrganizationConfigurationResponse extends Array<IUpdateOrganizationConfigurationRequest> {
2
+ }
3
+ export interface IUpdateOrganizationConfigurationRequest {
4
+ key: string;
5
+ value: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -34,6 +34,7 @@ export interface IUpdateRecurringBookingResponse extends IModifyEntity<IBookingD
34
34
  discountPolicy?: string;
35
35
  delete_slot?: IDeleteBookingByCodesDto;
36
36
  update_slot?: IUpdateBookingByCodesDto;
37
+ extension_booking_codes?: string[];
37
38
  }
38
39
  export interface IUpdateRecurringSlotBookingDetailsRequest {
39
40
  customerName?: string;
@@ -7,7 +7,7 @@ export interface IUpdateStaffMemberResponse extends Modify<Omit<IUserEntity, "pa
7
7
  turfids?: string[];
8
8
  }
9
9
  export interface IUpdateStaffMemberRequest {
10
- firstname?: string;
10
+ name?: string;
11
11
  lastname?: string;
12
12
  phone?: number;
13
13
  turfids?: string[];
@@ -1,9 +1,16 @@
1
- import { OrganizationType } from "../../@enum";
2
- import { OrganizationStatus } from "../../enums/organization-status.enum";
1
+ import { ModificationDiscountPolicy, OrganizationType } from "../../@enum";
2
+ import { AllowManualBookingDiscount, OrganizationStatus } from "../../enums/organization-status.enum";
3
3
  import { ICouponEntity } from "./coupon.entity.interface";
4
4
  import { IEntityAuditColumn } from "./entity-audit-column.interface";
5
5
  import { ITurfEntity } from "./turf-entity.interface";
6
- export interface IOrganizationEntity extends IEntityAuditColumn, IOrganizationEntityRel {
6
+ export interface IOrganizationConfig {
7
+ allowManualBookingDiscount: AllowManualBookingDiscount;
8
+ bookingCreationDelay: number;
9
+ bookingModificationDelay: number;
10
+ bookingCancellationDelay: number;
11
+ modificationDiscountPolicy: ModificationDiscountPolicy;
12
+ }
13
+ export interface IOrganizationEntity extends IEntityAuditColumn, IOrganizationEntityRel, IOrganizationConfig {
7
14
  id: number;
8
15
  name: string;
9
16
  email: string | null;
@@ -17,6 +24,11 @@ export interface IOrganizationEntity extends IEntityAuditColumn, IOrganizationEn
17
24
  deed_file_path: string | null;
18
25
  status: OrganizationStatus;
19
26
  registrationId: number;
27
+ allowManualBookingDiscount: AllowManualBookingDiscount;
28
+ bookingCreationDelay: number;
29
+ bookingModificationDelay: number;
30
+ bookingCancellationDelay: number;
31
+ modificationDiscountPolicy: ModificationDiscountPolicy;
20
32
  }
21
33
  export interface IOrganizationEntityRel {
22
34
  turfs: ITurfEntity[];
@@ -4,16 +4,16 @@ import { UserType } from "../../enums/valid-type.enum";
4
4
  import { ITurfEntity } from "./turf-entity.interface";
5
5
  export interface IUserEntity extends IEntityAuditColumn, IUserEntityRel {
6
6
  id: number;
7
- firstname: string;
7
+ name: string;
8
8
  phone: string;
9
9
  password: string;
10
10
  email: string;
11
11
  status: UserStatus;
12
- is_email_verified: boolean;
13
- is_mobile_verified: boolean;
14
- is_account_verified: boolean;
15
- require_new_password: boolean;
16
- organization_id: number;
12
+ isEmailVerified: boolean;
13
+ isMobileVerified: boolean;
14
+ isAccountVerified: boolean;
15
+ requireNewPassword: boolean;
16
+ organizationId: number;
17
17
  type: UserType;
18
18
  registrationId: number;
19
19
  comments: string | null;
@@ -10,12 +10,12 @@ export interface IGetBookingById extends Omit<IBookingDetailsEntity, "createdBy"
10
10
  discountedCost: number;
11
11
  amountPaid: number;
12
12
  createdBy: {
13
- firstname: string;
13
+ name: string;
14
14
  type: UserType;
15
15
  id: number;
16
16
  };
17
17
  updatedBy: {
18
- firstname: string;
18
+ name: string;
19
19
  type: UserType;
20
20
  id: number;
21
21
  };
@@ -1,5 +1,13 @@
1
+ import { WeekdayTimeSlot } from "../../@model";
1
2
  import { ChargesModel } from "../../models/charge-model";
2
3
  import { IBookingDetailsEntity } from "../entity/booking-details-entity.interface";
4
+ export interface IEventBookingDetails {
5
+ startDateCode: number;
6
+ endDateCode: number;
7
+ weekdaySlots: WeekdayTimeSlot[];
8
+ pitchIds: number[];
9
+ }
3
10
  export interface IBookingDetailsModel extends IBookingDetailsEntity {
4
11
  assignCharges(chargeModel: ChargesModel): void;
12
+ getEventDetails(): IEventBookingDetails;
5
13
  }
@@ -1,3 +1,3 @@
1
1
  import { IUserEntity } from "./entity";
2
- export interface IUserEntityEssentialInfo extends Pick<IUserEntity, "id" | "firstname" | "phone" | "email" | "type"> {
2
+ export interface IUserEntityEssentialInfo extends Pick<IUserEntity, "id" | "name" | "phone" | "email" | "type"> {
3
3
  }
@@ -20,7 +20,7 @@ export declare class BookingCode {
20
20
  getHalfHourTimeCodes(): string[];
21
21
  /**
22
22
  *
23
- * @returns {Array<string>} - List of half hour time slot codes between start time & end time inclusive
23
+ * @returns ['00000030','00300100','01000130']: string[] - List of half hour time slot codes between start time & end time inclusive
24
24
  * @example fromTime: 0000; toTime: 0130
25
25
  * // returns ['00000030','00300100','01000130']
26
26
  */
@@ -30,7 +30,18 @@ export declare class BookingCode {
30
30
  getWeekday(): number;
31
31
  getMonthCode(): string;
32
32
  getDateWithFromTimeCode(): string;
33
+ getDateWithToTimeCode(): string;
33
34
  getCodeWithoutTurfCode(): string;
35
+ getPriceByPriceEntities(priceEntities?: {
36
+ [date: string]: {
37
+ [time: string]: number;
38
+ };
39
+ }): number;
40
+ getToDate(): Date;
41
+ isAcrossDate(): boolean;
42
+ isModificationAllowed(delayInMinutes?: number): boolean;
43
+ isDeletionAllowed(delayInMinutes?: number): boolean;
44
+ isCreationAllowed(delayInMinutes?: number): boolean;
34
45
  static sortByCode(bookingCodes: BookingCode[]): void;
35
46
  static getOneSlotBookingCode(turfId: string, bookingDate: string, fhfm: string, thtm: string, pitchCode: string): string;
36
47
  static getDiscountedCost(couponCode: string, totalCost: number, validationApply?: boolean, totalBookingHours?: number): number;
@@ -40,12 +51,13 @@ export declare class BookingCode {
40
51
  static getWeekday(dateCode: number): number;
41
52
  static convertToDate(str: string): Date;
42
53
  static previousDateChecker(fromDate: number, index: number, errorKey?: string): void;
43
- static previousTimeChecker(fromTime: string, fromDate: number, index: number): void;
54
+ static previousTimeChecker(fromTime: string, fromDate: number, index: number, bookingDelayInMinutes?: number, date?: Date): void;
44
55
  static getDateCodesByWeek(fromDate: number, toDate: number, selectedWeekday: number): string[];
45
56
  static getDatesByWeek(fromDate: number, toDate: number, selectedWeekday: number): Date[];
46
57
  static isValidTimeRange(timeSlot: string): boolean;
47
58
  static dateFormat(dates: Array<Date>): Array<string>;
48
59
  static getDateCode(date: Date): string;
60
+ static getMonthCode(date: Date): number;
49
61
  /**
50
62
  * Returns list of month codes (YYMM) in the Date range inclusive
51
63
  * @param {Date} from - Start Date
@@ -136,4 +148,6 @@ export declare class BookingCode {
136
148
  * Additionally, the pitch number and turf ID must match between the two codes.
137
149
  */
138
150
  isAdjacentBookingCode(nextBookingCode: BookingCode): boolean;
151
+ static getInstanceByComponents(turfId: number, pitchCode: number, dateCode: number, fromTimeCode: string, toTimeCode: string, priceCsv: string): BookingCode;
152
+ isTimeSlotContinuous(that: BookingCode): boolean;
139
153
  }