Time to actually start booking properties. But first, how much would they cost? Let's introduce the pricing structure.
To be honest, if we try to implement all possible pricing features from Booking.com, that alone would take weeks to write/read: various "genius levels" for discounts, different prices per guest, etc.
So let's focus on the core functionality: pricing per calendar days. Typically, some resorts would cost more in July than in January, so let's work on modeling exactly that.
Goals of This Lesson
- Prices DB structure
- Showing prices in search results
- Filter by price range
- Automated test for pricing
By the end of this lesson, we will have this price calculated and shown in Postman:

Prices DB Structure
We will attach the price not to the property but to the Apartment level. The apartment may have many prices, depending on dates, so here's our DB structure for it:...
Here's something I dont get, the tests run smoothly but price result in postman is 0
Hi, this scope is not working properly. Look at this example:
Guests are leaving the apartment on 2025-02-20, and new guests want to book it from the same date. This should be possible, but it's not. The first guests leave the apartment, for example, at 10 AM, and the new guests should be able to book it from 2 PM.
For calculate price this scope is okay, but not for bookings.