Book (v1.0.0)
Book domain entity, encapsulates book information and business rules
Overview
This entity represents a book in the catalog. It encapsulates book information and business rules, such as a unique identifier, a title, a description, an image, a price, a status, an average rating, a total number of reviews, a category, a publisher, and a flag indicating whether the book is deleted or not. The entity also has a version property for optimistic concurrency control.
Entity Properties
Name | Type | Required | Description |
---|---|---|---|
id | UUID | Required | Unique identifier for the book |
name | string | Required | A title of the book |
description | string | Optional | Description of the book |
image | string | Optional | Image of the book |
price | Price | Required | Price of the book include Original price and Sale price |
status | int | Required | Status of the book |
averageRating | double | Required | Average rating of the book |
totalReviews | int | Required | Total number of reviews for the book |
categoryId | UUID | Required | Unique identifier for the category |
publisherId | UUID | Required | Unique identifier for the publisher |
isDeleted | bool | Required | Whether the book is deleted or not |
createdAt | DateTime | Required | The date and time the book was created |
lastModifiedAt | DateTime | Optional | The date and time the book was updated |
version | UUID | Required | Version of the record for optimistic concurrency control |
Entity Relationships
- A book is categorized under one category
- A book is published by one publisher
- A book is written by multiple authors
- A book has multiple reviews
- A book is ordered by multiple orders
- A book is added to multiple baskets