Detailed design of database tables

Một phần của tài liệu Integrated online bookstore website with management system (Trang 99 - 105)

Books Name Data Type Description

BookId nvarchar (450) Unique identifier for each book.

BookName nvarchar (max) Name of the book.

BookSlug nvarchar (max) URL string for the book name.

Price Int Selling price of the book.

Description nvarchar (max) Detailed description of the book's content . ImportedQuantity Int Quantity of books imported into inventory.

Location nvarchar (max) Storage location of the book in the warehouse.

Image nvarchar (max) URL or file name of the book's representative image.

100

AuthorId nvarchar (450) Foreign key referencing the Authors table, representing the book's author.

CategoryId nvarchar (450) Foreign key referencing the Categories table, defining the book's category.

SoldQuantity int

Number of books sold.

BookCode nvarchar (max) Internal code, used for system management.

Table 3.37. Design of Database Tables: Books Orders

Name Data Type Description

OrderId nvarchar (255) Unique identifier for each order.

OrderCode nvarchar (255) A unique code representing the order, used for tracking and referencing.

UserId nvarchar (255) Foreign key referencing the user who placed the order.

CreateDate Datetime The date and time when the order was created.

Status int Indicates the current status of the order Address nvarchar (max) The shipping address for the order.

PhoneNumber nvarchar (max) The contact phone number of the customer for this order.

TotalAmount Int The total monetary value of the order (in VND).

PaymentMethod nvarchar (max) The method of payment chosen by the customer

FullName nvarchar (max) The full name of the customer placing the order.

Table 3.38. Design of Database Tables: Orders

101 Authors

Name Data Type Description

AuthorId nvarchar (450) A unique identifier for each author, used as the primary key.

AuthorName nvarchar (max) The name of the author.

AuthorSlug nvarchar (max) A user-friendly slug representing the author's name, often used in URLs Infomation nvarchar (max) Detailed information about the author.

Image nvarchar (max) URL to the author’s profile picture or portrait.

AuthorCode nvarchar (max) An additional identifier, which can be used for management purposes.

Table 3.39. Design of Database Tables: Authors Categories

Name Data Type Description

CategoryId nvarchar (450) A unique identifier for each category, used as the primary key.

CategoryName nvarchar (max) The name of the category.

CategorySlug nvarchar (max) A user-friendly slug representing the category name, often used in URLs.

Description nvarchar (max) A brief description of the category's purpose or content.

CategoryCode nvarchar (max) An additional identifier, which can be used for internal management or references.

Table 3.40. Design of Database Tables: Categories

102 OrderDetails

Name Data Type Description

Id nvarchar (255) A unique identifier for each order detail entry.

OrderCode nvarchar (255) A code representing the associated order, linking to the main order table.

BookId nvarchar (255) A unique identifier for the book included in the order, referencing the book table.

Price int The price of the book at the time the order was placed.

Quantity int The quantity of the book purchased in the order.

Table 3.41. Design of Database Tables: OrderDetails Wishlists

Name Data Type Description

WishlistId nvarchar (450) A unique identifier for each item in the user's wishlist.

BookId nvarchar (450) A unique identifier for the book in the wishlist, linking to the Book table.

UserId nvarchar (max) The user ID, identifying the owner of the wishlist.

Table 3.42. Design of Database Tables: Wishlists VnpayInfor

Name Data Type Description

Id nvarchar (450) A unique identifier for each order transaction.

OrderDescription nvarchar (max) A description of the order, providing details of the items or service ordered.

TransactionId nvarchar (max) A unique identifier for the transaction, used for tracking payment status and processing.

PaymentMethod nvarchar (max) The method of payment used for the order

103

CreateDate datetime The date and time when the order was created.

OrderCode nvarchar (max) A code representing the order, used for tracking and identifying the order in the system.

Table 3.43. Design of Database Tables: VnpayInfor

ASP.NET Core Identity and Automatically Generated Tables

In this system, user authentication and authorization are managed through ASP.NET Core Identity. This framework automatically creates the necessary tables for user management, including AspNetUsers, AspNetRoles, AspNetUserRoles, and other related tables. These tables handle user information, roles, and the relationships between users and roles, ensuring secure user management without the need for manual table creation.

AspNetUsers

Name Data Type Description

Id nvarchar (450) A unique identifier for the user.

UserName nvarchar (256) The username chosen by the user for logging in.

Email nvarchar (256) The email address of the user, used for authentication and communication.

PasswordHash nvarchar (max) A hashed version of the user's password for secure authentication.

SecurityStamp nvarchar (max) A unique token used to track changes in security information

ConcurrencyStamp nvarchar (max) A unique value used to handle concurrency conflicts when updating user data.

PhoneNumber nvarchar (max) The user's phone number, used for contact or authentication.

Address nvarchar (max) The address of the user.

104

FullName nvarchar (max) The full name of the user, typically used for display

RoleId nvarchar (max) The role ID assigned to the user, which links to the roles defined in the system.

Token nvarchar (max) A unique token for the user, used for

password resets, email verification, or other actions.

Table 3.44. Design of Database Tables: AspNetUsers AspNetUserRoles Name Data Type Description

UserId nvarchar (450) A unique identifier for the user, used to link the user to their assigned role.

RoleId nvarchar (450) A unique identifier for the role, used to define the user’s access level or permissions.

Table 3.45. Design of Database Tables: AspNetUserRoles AspNetRoles

Name Data Type Description

Id nvarchar (450) A unique identifier for the role, typically used as the primary key.

Name nvarchar (256) The name of the role Table 3.46. Design of Database Tables: AspNetRoles

105

Một phần của tài liệu Integrated online bookstore website with management system (Trang 99 - 105)

Tải bản đầy đủ (PDF)

(125 trang)