Behaviour changes
For now on page selected book:
1) We need to add some text or symbol with tooltip that this book is blocked.
2) The button for starting reading book must be disabled (red color) if it is blocked.
3) If somehow request for starting reading the book will be sent it will be rejected on the server side with bad request response type and status 400. Error body example:
{'detail': 'This book is blocked'}
4) Please pay attention, there must two additional cases:
If page is loaded, the button is "greeen", after clicking to add book and validation raises an exception that the book is blocked, you need to "update" the book to the "red" one.
If you are trying to stop reading the book, and clicking "remove book from list of reading books", if the book already in the blocked state, the "red" button must appear.
So to summarize, we must validate these things only at "adding book to reading list" and on "removing book from list of reading" in all other cases it must not change the behaviour.
We are going to add a possibility to block the book from the admin side.
Model changes So, for now, the Book object will additionally have new field blocked_book.
New Book object example:
Behaviour changes For now on page selected book: 1) We need to add some text or symbol with tooltip that this book is blocked. 2) The button for starting reading book must be disabled (red color) if it is blocked. 3) If somehow request for starting reading the book will be sent it will be rejected on the server side with bad request response type and status 400. Error body example:
{'detail': 'This book is blocked'}
4) Please pay attention, there must two additional cases:So to summarize, we must validate these things only at "adding book to reading list" and on "removing book from list of reading" in all other cases it must not change the behaviour.