Tuesday, March 12, 2024
1 change · master
Resolved issues and error corrections
Rental product availability now reflects early pickups and early returns, so customers are less likely to book unavailable items or be blocked from available ones. The update improves the online rental experience and cleans up related tests to better protect this behavior going forward.
Original PR description
Previously, only the expected pickup and return dates were considered when computing a rental product's availabilities. Early pickups and returns were ignored. This allowed customers to rent products that weren't available (due to early pickups), or prevented customers from renting products that were available (due to early returns). This PR updates the computation to take early pickups and returns into account. Note that late pickups and returns are not considered, and shouldn't be. Indeed, we don't know when late pickups and returns will happen, and we don't want to guess. Late pickups are considered unavailable (until the expected return date), and late returns are considered available. This PR also refactors the tests in `sale_stock_renting` and `website_sale_stock_renting` to: - Follow unit testing best practices - Extract shared helper methods - Fix incorrect tests - Remove useless test messages task-3576910