New implementation for Allowing rentability for overlapping periods with different weekdays

Current behavior for Rentability rules: Currently the splitting/blocking logic is only based on stay dates and booking dates. No other parameters from the rentability rule are taken into consideration for splitting/blocking logic of rentability rules.

Problem statement: Currently it is not possible to have two rentability rules for the same period active even if they have different conditions. means if the same stay periods for both the rentability rules but the changes in arr/dept days or length of stays then one old rule was blocked and a new one was inserted.

Expected behavior: We should also consider the arrival weekdays mentioned in the rentability rule along with the stay period and booking period for deciding the splitting/blocking logic.

Problem statement: It is not possible to define multiple conditions for different weekdays within the selected period.

Let us understand with an example of the rentability rule:-

 

Stay period

Booking period

Min los

Arrival weekdays

 

Stay period

Booking period

Min los

Arrival weekdays

Existing rule

1 Mar -31 Dec

1 Jan -

3

Fri

New rule to be added

1 Mar - 31 Dec

1 Jan -

4

Mon

Current behavior:

 

Stay period

Booking period

Min los

Arrival weekdays

 

Stay period

Booking period

Min los

Arrival weekdays

Existing rule blocked

1 Mar -31 Dec

1 Jan - 7 Dec

3

Fri

New rule added

1 Mar - 31 Dec

7 Dec -

4

Mon

 

 

Expected behavior:

 

Stay period

Booking period

Min los

Arrival weekdays

 

Stay period

Booking period

Min los

Arrival weekdays

Existing rule remains active as it is applicable only for Fri falling in the selected stay period.

1 Mar -31 Dec

1 Jan -

3

Fri

New rule added

1 Mar - 31 Dec

7 Dec -

4

Mon

 

 

Areas where the logic needs to be implemented:-

  1. Rentability set → Rentability rules card

  2. Accommodation type → Representation ---> rentability rules card (Rate manager and content manager)

  3. Accommodation type → rentability rules card (Rate manager and content manager).

  4. Offers --> Representation ---> rentability rules card.

  5. Offers → Rentability card.

  6. Importing rentability rules for rentability set.

  7. Importing rentability rules for representation.

  8. Batch update of rentability (add new, update existing, block)

Please refer to the file '' for more basic scenarios.

Note:- The splitting and blocking logic followed for overlapping periods still remains the same. The only thing is that also arrival weekdays in the rentability should be taken into consideration.

Ticket:- https://maxxton.atlassian.net/browse/MXTS-36673