Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Release Sprint 1 #16

Merged
merged 17 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: hardingadonis
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: hardingadonis
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Build with Maven'

on: [push, pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

name: 'Build on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}

steps:
- name: 'Checkout repository'
uses: actions/checkout@v4

- name: 'Set up JDK 8'
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
architecture: 'x64'

- name: 'Build project with Maven'
run: mvn verify
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Release Sale Dock'

on:
workflow_run:
workflows: [Build with Maven]
types:
- completed
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release:
name: 'Release Sale Dock'
runs-on: ubuntu-latest

if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: 'Checkout repository'
uses: actions/checkout@v4

- name: 'Get version'
id: get_version
run: |
chmod +x get_version.sh
echo "version=$(./get_version.sh)" >> $GITHUB_OUTPUT

- name: 'Release Sale Dock'
uses: softprops/action-gh-release@v0.1.15
with:
name: 'Sale Dock - v${{ steps.get_version.outputs.version }}'
tag_name: ${{ steps.get_version.outputs.version }}
generate_release_notes: true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# Maven
target/

# NetBeans
nbproject/
nb-configuration.xml
server/*.war
7 changes: 7 additions & 0 deletions .imgbotconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"schedule": "daily",
"ignoredFiles": [
],
"compressWiki": "false",
"minKBReduced": 0
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Minh Vương

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
12 changes: 12 additions & 0 deletions database/database.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions database/setup.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
CREATE TABLE `customer` (
`id` int PRIMARY KEY AUTO_INCREMENT COMMENT 'ID dùng để quản lý, tự động tăng',
`code` varchar(255) UNIQUE COMMENT 'Mã khách hàng, sẽ hiện trên giao diện, ID thì không hiện',
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`created_at` TIMESTAMP DEFAULT null,
`updated_at` TIMESTAMP DEFAULT null
);

CREATE TABLE `product` (
`id` int PRIMARY KEY AUTO_INCREMENT COMMENT 'ID dùng để quản lý, tự động tăng',
`code` varchar(255) UNIQUE COMMENT 'Mã sản phẩm, sẽ hiện trên giao diện, ID thì không hiện',
`name` varchar(255) NOT NULL,
`description` TEXT,
`price` REAL NOT NULL,
`category_id` varchar(255) NOT NULL,
`image_url` LONGTEXT,
`created_at` TIMESTAMP DEFAULT null,
`updated_at` TIMESTAMP DEFAULT null
);

CREATE TABLE `category` (
`id` int PRIMARY KEY AUTO_INCREMENT COMMENT 'ID dùng để quản lý, tự động tăng',
`name` varchar(255) NOT NULL
);

CREATE TABLE `employee` (
`id` int PRIMARY KEY AUTO_INCREMENT COMMENT 'ID dùng để quản lý, tự động tăng',
`code` varchar(255) UNIQUE COMMENT 'Mã nhân viên, sẽ hiện trên giao diện, dùng để đăng nhập, vd QE170001',
`password` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`created_at` TIMESTAMP DEFAULT null,
`updated_at` TIMESTAMP DEFAULT null
);

CREATE TABLE `order` (
`id` int PRIMARY KEY AUTO_INCREMENT COMMENT 'ID dùng để quản lý, tự động tăng',
`code` varchar(255) UNIQUE,
`employee_id` int NOT NULL,
`customer_id` int NOT NULL,
`status` ENUM ('pending', 'shipping', 'done', 'canceled') NOT NULL,
`total` REAL NOT NULL,
`note` TEXT DEFAULT null,
`created_at` TIMESTAMP DEFAULT null,
`updated_at` TIMESTAMP DEFAULT null
);

CREATE TABLE `order_detail` (
`order_id` int,
`product_id` int,
`quantity` int NOT NULL,
PRIMARY KEY (`order_id`, `product_id`)
);

ALTER TABLE `order` ADD FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`);

ALTER TABLE `order_detail` ADD FOREIGN KEY (`order_id`) REFERENCES `order` (`id`);

ALTER TABLE `product` ADD FOREIGN KEY (`category_id`) REFERENCES `category` (`id`);

ALTER TABLE `order_detail` ADD FOREIGN KEY (`product_id`) REFERENCES `product` (`id`);

ALTER TABLE `order` ADD FOREIGN KEY (`employee_id`) REFERENCES `employee` (`id`);
7 changes: 7 additions & 0 deletions get_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

major_version=0
minor_version=0
path_version=1

echo "$major_version.$minor_version.$path_version"
56 changes: 56 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.hardingadonis</groupId>
<artifactId>saledock</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>

<name>Sale Dock</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.6.15.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<outputDirectory>${project.basedir}/server/</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.hardingadonis.saledock.controller;

public class Controller {

}
5 changes: 5 additions & 0 deletions src/main/java/io/hardingadonis/saledock/model/Model.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.hardingadonis.saledock.model;

public class Model {

}
5 changes: 5 additions & 0 deletions src/main/java/io/hardingadonis/saledock/utils/Utils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.hardingadonis.saledock.utils;

public class Utils {

}
Empty file.
2 changes: 2 additions & 0 deletions src/main/webapp/META-INF/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/saledock"/>