async Task <BorrowResponseModel> IBikeApplicationService.Borrow(Guid bikeId, Guid userId) { var bike = await _bikeRepository.GetBikeBy(bikeId); var responseModel = new BorrowResponseModel(); if (bike != null) { responseModel.MarkAsFound(); if (bike.IsActive) { responseModel.MarkAsBorrowable(); bike.BorrowBike(); var price = _priceRepository.GetLastPrice(); await _borrowRepository.AddBorrow(Borrow.Create(bikeId, userId, price.Id)); await _bikeRepository.UpdateBike(bike); } } return(responseModel); }