Book Versions Updating requests to the database to include `book_version`
Update Queries and functions to retrieve book by version and latest version.
-
Create newVersion command at the domain service At the folder server/services/CommandService/domainCommands we can add a new command for the new Version where the creation of the book could be used. Could be a wrapper for the call to the createDomain service command (this command involves the cration of a new book - server/services/CommandService/domainCommands/commands/createCommand.js
) by passing the correct data and do the necessary updates for the relationships that already exist for the previous book versions. So for example if we create a new book version we need to update the collection that the book was belonging to. we need to update the teams to point to the latest book versions -
When we will create a new Version we need to Update the column components
of the Collection because it will have the reference to the old version of the book. -
Add a new column parent_id
to thebooks
table. This will benull
for the original book, for all the subsequent versions created, it will store the uuid of original book. -
When we create a new book Version we need to move the teams that had been for the older version to the newest version . -
Create a function at the model of the book that will return a book instance of a requested book version , by providing a version name and version number . -
Book version alias should be created from the last version