You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
641 B

package com.example.services
import monix.eval.Task
import com.example.models.Book
import com.example.models.Author
import com.example.models.NewAuthor
import com.example.models.NewBook
trait TaskLibraryService {
// Simple function that returns a book
def findBookById(id: Long): Task[Option[Book]]
// Simple function that returns a list of books with it's author
def findBooksWithAuthor: Task[Seq[(Book, Author)]]
// Insert a book and an author composing two DBIOs in a transaction
def insertBookAndAuthor(book: NewBook, author: NewAuthor): Task[(Long, Long)]
def getAuthorsForBook(id: Long): Task[Seq[(Author, Book)]]
}