From the course: Build Spring Boot Apps with the Kotlin Programming Language

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Solution walk-through

Solution walk-through

- [Instructor] Okay, well I hope you have done it, I'll do the work now. I think we'll start with this find booking one, so in booking service, we're creating a function called find booking. That takes two parameters which are a seat and a performance. And it's going to return an object of type, booking. So let's import booking, first of all. What we'll need to do in here is go to our booking repository and see if we can find any booking that matches the ones we're looking for with our seat and performance. Well actually, it's the same code as we've got up here in is seat three, so I think what we could do is cut this from here and paste it down there. Actually, let's make this a null-able booking and then what we could do is return matched bookings.first or null. So getting the list of bookings, we're saying if there is one, return it. If not, return a null. So that's our find booking, and then up here when we do is seat three, we can say let's set matched bookings to our find…

Contents