Skip to content

Commit

Permalink
Version 1.0.0 (#145)
Browse files Browse the repository at this point in the history
* Initial frontend

* Header and Footer UI.

* add idea folder to .gitignore

* [BE] Create database (#3)

* [Fix] Delete all data in frontend/ folder

* Feature/sidebaradmin (#23)

* add code demo date 28/02/23

* source code homepage date 05/03/20230

* Dev sidebar and manage form create router

* Update call API

---------

Co-authored-by: trandangnguyenbao <[email protected]>

* Homepages (#25)

* add code demo date 28/02/23

* source code homepage date 05/03/20230

* add source code home page and catagory

* update page product

* Resolve conflict homepage

---------

Co-authored-by: trandangnguyenbao <[email protected]>

* Filter product (#27)

* update page product and navbar, dashboard

* add database and product detail page

* implement filter product with fake database

* push source code task filter product

* resolve commit change with recommend from Dat

* Database change user role type (#29)

* config .gitignore for project and backend/

* Sua role User tu boolean thanh string

* Full User Page Layout (#30)

* update page product and navbar, dashboard

* add database and product detail page

* implement filter product with fake database

* push source code task filter product

* payment page and cart page

* test

* source code layout and page using for user

* sort_product

* Feature/manage user (#28)

* Manage User bug handle upload image

* UI ManageUser vs inext8

* View Product with pagination

* Responsive dashboard

* Search Deouce

* Feature/manage user (#32)

* Manage User bug handle upload image

* UI ManageUser vs inext8

* View Product with pagination

* Reponsive dashboard

* Edit path add module

* Search Deouce

* Config store redux

* clean and construct directory (#38)

* construct directory and update database (#39)

* connect to database via docker (#40)

* Code scanning configuration (#41)

* Update codeql.yml (#43)

* Login update (#48)

* responsive home page

* responsive in 07/04/202

* update login page and register page and Cart Using Redux Toolkit

* refactor: Update Menu select and home page item

* refactor: resolve conflict

* reverse file in API folder

* Feature/login cart fix (#49)

* Fix and Update Cart and Login

* Fix store

* Fix store

* Fix store v2

* Fix store

* Update cart

* Delete path

* Delete store.js (#50)

* Create Store

* remove store.js

* Fix store (#51)

* Delete path

* Create Store

* Create Store

* handle error

* Hanlder error (#53)

* remove store.js

* handle error

* API Product + Category (#54)

* base Product API with exception handle

* update documentations

* make API documentation with OpenAPI 3.0

* complete API product and category

* FEAT: RESPONSIVE CART PAGE AND PAYMENT PAGE

* Hotfix product (#58)

* Update Cart Page

* Hotfix product (#59)

* CALL API

* REFACTOR: Update menu

* User & User Address API + Authentication/Authorization (#60)

* configurage for logging

* base setup for user and useraddress

* update documentation

* update API get products of category endpoint

* handle register/login user and response token

* update user api and exception handler

* User Address API and clean up the rest

* add authorize for Swagger and update json request

* authorization implementation

* handle authentication exception

* CORS handle

* default admin generation one time when startup

* config CORS

* update register and authenticate API

* FEAT: Call API in Cart Page

* update documentation

* set JWT expiration to 1 day

* Hotfix cors jwt (#65)

* update documentation

* set JWT expiration to 1 day

* hotfix CORS

* Implement Order API

* update database

* update permissions

* update RolePermission documentation

* Feature/handle crud admin (#69)

* Delete path

* Create Store

* Code handle login

* Login

* allow no authorize for get all products and categories (#70)

* FEAT: add login logic

* handle login register

* Implement Order Detail API

* update role & permission

* update request validation

* update attribute in order table

* update role & permission

* Modify rq header axios

* Update Header handle redux

* handle transaction orderdetail - product quantity

* clean up and update exception handler

* handle transaction cascade user-order-orderdetail (#74)

* Rating API (#75)

* handle transaction cascade user-order-orderdetail

* implement Rating API

* update role & permission

* clean code

* FEATURE: CALL API

* new code

* Crud User admin

* FEATURE: Add Update Account Page

* Done crud Product

* REFACTOR: Update code Add Address

* Handle crud user and Products (#77)

* Delete path

* Create Store

* Crud User admin

* Done crud Product

* Protect roles

* FEATURE: account handle

* update sẻach

* Page product for category and logout redirect

* Email Verification (#83)

* config CORS

* base mail sender

* optimize method and enable HTTP/2

* update mail configuration and template

* update admin default name

* implement registration email sender

* handle async email sending

* handle email verification to enable user

* update documentation

* Modify and logic

* Reset Password + Change Password (#85)

* update register api not response token

* handle reset-password and change password API

* Modify and logic (#86)

* FEATURE: MANAGER ORDER

* Allow no email verification to login (#89)

* FEATURE: Update login and Register

* handle old new password (#91)

* FEATURE: Handle Login And ResetPassWord

* Ready for testing and deploying phase (#93)

* Initial frontend

* Header and Footer UI.

* [BE] Create database (#3)

* Feature/sidebaradmin (#23)

* Homepages (#25)

* update page product

* Filter product (#27)

* update page product and navbar, dashboard

* add database and product detail page

* implement filter product with fake database

* Database change user role type (#29)

* Full User Page Layout (#30)

* update page product and navbar, dashboard

* add database and product detail page

* implement filter product with fake database

* payment page and cart page

* sort_product

* Feature/manage user (#28)

* Manage User bug handle upload image

* UI ManageUser vs inext8

* View Product with pagination

* Responsive dashboard

* Search Deouce

* Feature/manage user (#32)

* Manage User bug handle upload image

* UI ManageUser vs inext8

* View Product with pagination

* Responsive dashboard

* Search Deouce

* Config store redux

* clean and construct directory (#38)

* construct directory and update database (#39)

* connect to database via docker (#40)

* Code scanning configuration (#41)

* Update codeql.yml (#43)

* Login update (#48)

* responsive home page

* update login page and register page and Cart Using Redux Toolkit

* Feature/login cart fix (#49)

* Update cart

* API Product + Category (#54)

* base Product API with exception handle

* update documentations

* make API documentation with OpenAPI 3.0

* complete API product and category

* FEAT: RESPONSIVE CART PAGE AND PAYMENT PAGE

* Update Cart Page

* CALL API

* User & User Address API + Authentication/Authorization (#60)

* configurage for logging

* base setup for user and useraddress

* update documentation

* update API get products of category endpoint

* handle register/login user and response token

* update user api and exception handler

* User Address API and clean up the rest

* add authorize for Swagger and update json request

* authorization implementation

* handle authentication exception

* CORS handle

* default admin generation one time when startup

* update register and authenticate API

* FEAT: Call API in Cart Page

* update documentation

* Implement Order API

* update database

* update permissions

* update RolePermission documentation

* Feature/handle crud admin (#69)

* Create Store

* Login

* allow no authorize for get all products and categories (#70)

* FEAT: add login logic

* handle login register

* Implement Order Detail API

* update role & permission

* update request validation

* update attribute in order table

* update role & permission

* Modify rq header axios

* Update Header handle redux

* handle transaction orderdetail - product quantity

* clean up and update exception handler

* handle transaction cascade user-order-orderdetail (#74)

* Rating API (#75)

* handle transaction cascade user-order-orderdetail

* implement Rating API

* update role & permission

* clean code

* FEATURE: CALL API

* Crud User admin

* FEATURE: Add Update Account Page

* REFACTOR: Update code Add Address

* Handle crud user and Products (#77)

* Create Store

* Crud User admin

* Done crud Product

* Protect roles

* FEATURE: account handle

* update search

* Page product for category and logout redirect

* Email Verification (#83)

* config CORS

* base mail sender

* optimize method and enable HTTP/2

* update mail configuration and template

* update admin default name

* implement registration email sender

* handle async email sending

* handle email verification to enable user

* update documentation

* Reset Password + Change Password (#85)

* update register api not response token

* handle reset-password and change password API

* Modify and logic (#86)

* FEATURE: MANAGER ORDER

* Allow no email verification to login (#89)

* FEATURE: Update login and Register

* handle old new password (#91)

* FEATURE: Handle Login And ResetPassword

---------

Co-authored-by: Dinh Quang Huy <[email protected]>
Co-authored-by: Dinh Quang Huy <[email protected]>
Co-authored-by: trandangnguyenbao <[email protected]>
Co-authored-by: tdnbao281001 <[email protected]>
Co-authored-by: Nguyễn Trung Quốc <[email protected]>

* rating response include user full name (#94)

* FEATURE: CRUD Category & Search direct to product

* Remove form image add new user

* FEATURE: Rating For User

* FEATURE: Handle Admin DashBoard

* Backend testing (#99)

* test category service

* test product service

* update other and user

* update other and test user address

* test order

* update other and testOrderDetail

* add Discount attribute to Product

* REFACTOR: REMOVE FOLDER IMAGE

* REFACTOR: HANDLE REQUIRE IMAGE

* Fix conflict and Form add user

* FE login folder to Login

* refactor user

* refactor user address

* refactor authentication

* refactor category

* refactor product

* refactor rating

* CRUD product with image

* Protect routes login and Update Search

* refactor order and order detail

* FEATURE: Admin

* clean up

* Fix bug UI and login add product & user

* implement refund

* hotfix-refund

* Hot fix CRUD product

* Fix bbg

* Update Add Form

* REFACTOR: Resolve Logo

* Resolve price (#113)

* Ready for testing and deploy phase (#144)

* Update Search Product and use API Provinces

* validation form

* Testing service (#117)

* update category service test

* update product service test

* update user service test

* update user address service test

* update authenticate service test

* update order service test

* update order detail service test

* update rating service test

* Shipping api (#118)

* add role shipper and update permission

* update database attribute

* update and implement order service logic for shipping

* implement shipping API

* implement statistic API

* add get by role user API for order statistic

* clean code

* update get refund api

* update-validation-phone

* tt

* update

* update

* FIX: FIX Bu User and UI Dashboard Admin

* updatechangePassword

* test code

* updateRegister

* u

* t

* update

* completed split into 2 status

* FEAT: Handle Order and Style Step shipping

* Search product User and Back to Top

* Update search Client

* updateN

* ud

* FEAT: Handle Roles Shipper

* User address

* Update search both user admin Fix bug view User

* FEAT

* Feature/modify add product (#132)

* Update Search Product and use API Provinces

* Search product User and Back to Top

* Update search Client

* User address

* Update search both user admin Fix bug view User

---------

Co-authored-by: Dinh Quang Huy <[email protected]>

* add

* LoginAdmin

* UpdateLoginAdmin

* add get shipper with order asc API

* update service test and directory

* update api

* Update Shipper

* Shipper rolse

* FIX CSS TABLE

* Update Refund UI

* TEST BUG

* Fix validate and redirect

* Validate fullname

---------

Co-authored-by: Dinh Quang Huy <[email protected]>
Co-authored-by: Nguyễn Trung Quốc <[email protected]>
Co-authored-by: Dinh Quang Huy <[email protected]>
Co-authored-by: tdnbao281001 <[email protected]>
Co-authored-by: trandangnguyenbao <[email protected]>

---------

Co-authored-by: Dinh Quang Huy <[email protected]>
Co-authored-by: Dinh Quang Huy <[email protected]>
Co-authored-by: trandangnguyenbao <[email protected]>
Co-authored-by: tdnbao281001 <[email protected]>
Co-authored-by: Nguyễn Trung Quốc <[email protected]>
  • Loading branch information
6 people committed May 31, 2023
1 parent 6aa7a29 commit 8f41f36
Show file tree
Hide file tree
Showing 926 changed files with 118,813 additions and 24 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master", "staging", "dev" ]
schedule:
- cron: '0 7,19 * * 0-6'

jobs:
analyze:
name: Analyze vulnerabilities
runs-on: ubuntu-latest, windows-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
27 changes: 5 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/
git-credential-manager/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# idea folder
.idea/

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# VS Code
.vscode/

git-credential-manager/
33 changes: 33 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
8 changes: 8 additions & 0 deletions backend/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added backend/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions backend/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
30 changes: 29 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
This file is for pushing empty folder to remote repo!
# Back-end documentation

## Technologies

1. [MySQL](https://www.mysql.com/)
2. [Spring Boot 3](https://spring.io/projects/spring-boot)
3. Other Spring Ecosystems
- [Spring Data JPA](https://spring.io/projects/spring-data-jpa)
- [Spring Security](https://spring.io/projects/spring-security)
- [Spring Web](https://spring.io/projects/spring-web)
- [Spring Test](https://spring.io/guides/gs/testing-web/)

## Requirements

1. [Java 17+](https://adoptium.net/)
2. [Docker Desktop](https://www.docker.com/)

## Resources

1. [MySQL Scripts](assets/databases/mysql)
2. [Database Design](assets/images/database/database_design.png)
3. [Spring Security Architecture](assets/images/security)
4. [Documentation](docs)

## Documentation

1. [Connect to database](docs/ConnectDatabase.md)
2. [APIs](docs/APIs.md)
3. [Role & Permission](docs/RolePermission.md)
Binary file added backend/assets/databases/mysql/dbs_model.mwb
Binary file not shown.
Binary file added backend/assets/databases/mysql/dbs_model.mwb.bak
Binary file not shown.
184 changes: 184 additions & 0 deletions backend/assets/databases/mysql/dbs_model.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

-- -----------------------------------------------------
-- Schema myecommerce
-- -----------------------------------------------------

-- -----------------------------------------------------
-- Schema myecommerce
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `myecommerce` ;
USE `myecommerce` ;

-- -----------------------------------------------------
-- Table `myecommerce`.`User`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myecommerce`.`User` (
`UserID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`Email` VARCHAR(254) NOT NULL,
`Password` VARCHAR(255) NOT NULL,
`FullName` VARCHAR(255) NOT NULL,
`Gender` VARCHAR(255) NOT NULL,
`Phone` VARCHAR(255) NOT NULL,
`Image` LONGTEXT NOT NULL,
`Role` VARCHAR(255) NOT NULL,
`Locked` BIT(1) NOT NULL,
`Enabled` BIT(1) NOT NULL,
PRIMARY KEY (`UserID`),
UNIQUE INDEX `email_UNIQUE` (`Email` ASC) VISIBLE,
UNIQUE INDEX `phone_UNIQUE` (`Phone` ASC) VISIBLE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `myecommerce`.`UserAddress`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myecommerce`.`UserAddress` (
`UserAddressID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`UserID` BIGINT UNSIGNED NOT NULL,
`Address` VARCHAR(255) NOT NULL,
PRIMARY KEY (`UserAddressID`),
INDEX `fk_UserAddress_User1_idx` (`UserID` ASC) VISIBLE,
CONSTRAINT `fk_UserAddress_User1`
FOREIGN KEY (`UserID`)
REFERENCES `myecommerce`.`User` (`UserID`)
ON DELETE CASCADE
ON UPDATE RESTRICT)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `myecommerce`.`Order`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myecommerce`.`Order` (
`OrderID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`UserID` BIGINT UNSIGNED NOT NULL,
`AdditionalPrice` BIGINT UNSIGNED NOT NULL,
`PaymentType` VARCHAR(255) NOT NULL,
`Status` VARCHAR(255) NOT NULL,
`DateOrder` DATE NOT NULL,
`Address` VARCHAR(255) NOT NULL,
`IsPreparing` BIT(1) NOT NULL,
`DatePreparing` DATE NULL,
`IsShipping` BIT(1) NOT NULL,
`DateShipping` DATE NULL,
`IsCompleted` BIT(1) NOT NULL,
`DateCompleted` DATE NULL,
`WorkerID` BIGINT UNSIGNED NULL,
PRIMARY KEY (`OrderID`),
INDEX `fk_Order_User1_idx` (`UserID` ASC) VISIBLE,
CONSTRAINT `fk_Order_User1`
FOREIGN KEY (`UserID`)
REFERENCES `myecommerce`.`User` (`UserID`)
ON DELETE CASCADE
ON UPDATE RESTRICT)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `myecommerce`.`Category`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myecommerce`.`Category` (
`CategoryID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(255) NOT NULL,
`Slug` VARCHAR(255) NOT NULL,
`Image` LONGTEXT NOT NULL,
PRIMARY KEY (`CategoryID`),
UNIQUE INDEX `Slug_UNIQUE` (`Slug` ASC) VISIBLE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `myecommerce`.`Product`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myecommerce`.`Product` (
`ProductID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`CategoryID` BIGINT UNSIGNED NULL,
`Name` VARCHAR(255) NOT NULL,
`Slug` VARCHAR(255) NOT NULL,
`Image` LONGTEXT NOT NULL,
`ImageReview1` LONGTEXT NOT NULL,
`ImageReview2` LONGTEXT NOT NULL,
`ImageReview3` LONGTEXT NOT NULL,
`UnitPrice` BIGINT UNSIGNED NOT NULL,
`Discount` INT NULL,
`Quantity` INT UNSIGNED NOT NULL,
`Description` LONGTEXT NOT NULL,
`YearRelease` SMALLINT(4) NOT NULL,
`Manufacturer` VARCHAR(255) NOT NULL,
`Monitor` VARCHAR(255) NOT NULL,
`CPU` VARCHAR(255) NOT NULL,
`RAM` VARCHAR(255) NOT NULL,
`VGA` VARCHAR(255) NOT NULL,
`HardDisk` VARCHAR(255) NOT NULL,
`Camera` VARCHAR(255) NOT NULL,
`Battery` VARCHAR(255) NOT NULL,
`Memory` VARCHAR(255) NOT NULL,
`Demand` VARCHAR(255) NOT NULL,
`Status` BIT(1) NOT NULL,
PRIMARY KEY (`ProductID`),
INDEX `fk_Product_Category1_idx` (`CategoryID` ASC) VISIBLE,
UNIQUE INDEX `Slug_UNIQUE` (`Slug` ASC) VISIBLE,
CONSTRAINT `fk_Product_Category1`
FOREIGN KEY (`CategoryID`)
REFERENCES `myecommerce`.`Category` (`CategoryID`)
ON DELETE SET NULL
ON UPDATE RESTRICT)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `myecommerce`.`OrderDetail`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myecommerce`.`OrderDetail` (
`OrderID` BIGINT UNSIGNED NOT NULL,
`ProductID` BIGINT UNSIGNED NOT NULL,
`PurchasePrice` BIGINT UNSIGNED NOT NULL,
`Quantity` INT UNSIGNED NOT NULL,
`Status` VARCHAR(255) NULL,
PRIMARY KEY (`OrderID`, `ProductID`),
INDEX `fk_OrderDetail_Order1_idx` (`OrderID` ASC) VISIBLE,
INDEX `fk_OrderDetail_Product1_idx` (`ProductID` ASC) VISIBLE,
CONSTRAINT `fk_OrderDetail_Order1`
FOREIGN KEY (`OrderID`)
REFERENCES `myecommerce`.`Order` (`OrderID`)
ON DELETE CASCADE
ON UPDATE RESTRICT,
CONSTRAINT `fk_OrderDetail_Product1`
FOREIGN KEY (`ProductID`)
REFERENCES `myecommerce`.`Product` (`ProductID`)
ON DELETE RESTRICT
ON UPDATE RESTRICT)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `myecommerce`.`Rating`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myecommerce`.`Rating` (
`UserID` BIGINT UNSIGNED NOT NULL,
`OrderID` BIGINT UNSIGNED NOT NULL,
`ProductID` BIGINT UNSIGNED NOT NULL,
`RateAmount` TINYINT(1) UNSIGNED NOT NULL,
`Comment` LONGTEXT NOT NULL,
`DateRating` DATE NOT NULL,
PRIMARY KEY (`UserID`, `OrderID`, `ProductID`),
INDEX `fk_Rating_OrderDetail1_idx` (`OrderID` ASC, `ProductID` ASC) VISIBLE,
CONSTRAINT `fk_Rating_User1`
FOREIGN KEY (`UserID`)
REFERENCES `myecommerce`.`User` (`UserID`)
ON DELETE CASCADE
ON UPDATE RESTRICT,
CONSTRAINT `fk_Rating_OrderDetail1`
FOREIGN KEY (`OrderID` , `ProductID`)
REFERENCES `myecommerce`.`OrderDetail` (`OrderID` , `ProductID`)
ON DELETE CASCADE
ON UPDATE RESTRICT)
ENGINE = InnoDB;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
Binary file added backend/assets/images/api/json_body_template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/assets/images/api/swaggerUI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/assets/images/database/connection-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/assets/images/database/docker-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/assets/images/database/docker-done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/assets/images/security/authenticate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8f41f36

Please sign in to comment.