function book(payload) {const {accomodationId,adults,children,from,to} = payload;return async function (dependencies, context) {const user = context.loggedUser;if (!user) {return context.withError(shouldBeLogged())}const booking = {tenantId:user.id, accomodationId, hosts : {adults,children}, interval : Interval(from,to), };await dependencies.bookings.save(booking);return context;}}