|
ORE Studio 0.0.4
|
Service for managing books. More...
#include <book_service.hpp>

Public Types | |
| using | context = ores::database::context |
Public Member Functions | |
| book_service (context ctx) | |
| Constructs a book_service with required repositories. | |
| std::vector< domain::book > | list_books () |
| Lists all books. | |
| std::optional< domain::book > | find_book (const boost::uuids::uuid &id) |
| Finds a book by its ID. | |
| std::optional< domain::book > | find_book_by_code (const std::string &code) |
| Finds a book by its code. | |
| void | save_book (const domain::book &book) |
| Saves a book (creates or updates). | |
| void | save_books (const std::vector< domain::book > &books) |
| Saves multiple books (creates or updates). | |
| void | remove_book (const boost::uuids::uuid &id) |
| Removes a book. | |
| std::vector< domain::book > | get_book_history (const boost::uuids::uuid &id) |
| Gets the version history for a book. | |
Service for managing books.
This service provides functionality for:
|
explicit |
Constructs a book_service with required repositories.
| ctx | The database context. |
| void save_book | ( | const domain::book & | book | ) |
Saves a book (creates or updates).
| book | The book to save |
| void save_books | ( | const std::vector< domain::book > & | books | ) |
Saves multiple books (creates or updates).
| books | The books to save |
| void remove_book | ( | const boost::uuids::uuid & | id | ) |
Removes a book.
| id | The ID of the book to remove |
| std::vector< domain::book > get_book_history | ( | const boost::uuids::uuid & | id | ) |
Gets the version history for a book.
| id | The book ID |