Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 36

PROJECT ON

(Project Title)

Developed by

Members:
No. Student Name Student ID
1 Nguyen Huu Quynh Nhu Student1284552

2 Vo Huynh Ngoc Tram Student1267678


3
4

 Class No.:
 Start Date: 21/09/2021
 End Date: 21/10/2021
 Name of the Coordinator:
 Date of Submission:

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 1


SYSTEM ANALYSIS

System Summary:

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 2


CLASS DIAGRAM

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 3


DATABASE DESIGN

Database Name: mal_de_puerco


Number of tables:19
Tables Names:
1. users
2. roles
3. permissions
4. role_permissions
5. tables
6. tables_reservation
7. reservations
8. discounts
9. servings
10. serving_attributes
11. attributes
12. serving_categories
13. serving_image
14. orders
15. order_details
16. review_serving
17. review_order
18. invoices
19. payment_method
Schematic Diagram Of Database:
Schematic diagram of the database depicting the primary and foreign key
relationships.

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 4


TABLE DESIGN

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 5


Database Name:mal_de_puerco

1.users:
Field Name Data type Width Description

id int Auto increment User’s ID


code varchar 20 User’s code
name varchar 100 User's name
phone varchar 10 User’s phone
email varchar 255 User’s email
password varchar 255 User's password
role_id int User's role
created_at timestamp The time that the user
was created
status int User’s status

2.roles:
Field Name Data type Width Description

id int Auto increment role’s ID


code varchar 20 Role’s code
name varchar 100 Role’s name
created_at timestamp The time that the role
was created
status int role’s status

3.permissions:

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 6


Field Name Data type Width Description

id int Auto increment permission’s ID


code varchar 20 permission’s code
name varchar 100 permission’s name
created_at timestamp The time that the
permission was created
status int permission’s status

4.role_permissions:
Field Name Data type Width Description

id int Auto increment Id of role permission


role_id int id of table roles
permission_id int Id of table permissions
created_at timestamp The time that the role
permission was created

5.tables:
Field Name Data type Width Description

id int Auto increment table’s ID


code varchar 20 table’s code
name varchar 100 table's name
seats int Table’s seat
is_set int Show this table been set
up in the tablet or not

user_id int Waiter is responsible


for that table in his shift
created_at timestamp The time that the table

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 7


was created
status int table’s status
6.reservations:
Field Name Data type Width Description
id int Auto increment Reservation’s ID
code varchar 20 Reservation’s code
customer_name varchar 100 Customer's name of
reservation
phone varchar 10 Customer’s phone
email varchar 255 Customer’s email
date_pick date The date that the
customer wants to book
seats_pick int The seat(s) that the
customer wants to book
start_time time The start time that the
customer wants to book
end_time time The end time that the
customer wants to book
deposit decimal 10 Customer deposit
created_at timestamp The time that the
reservation was created
status int Reservation’s status

7.tables_reservation:
Field Name Data type Width Description

id int Auto increment Id of table reservation


table_id int id of table tables
reservation_id int Id of table reservation
created_at timestamp The time that the
table(s) reservation was
created

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 8


status int Status of tables
reservatiom

8.discounts:
Field Name Data type Width Description

id int Auto increment discount’s ID


code varchar 20 Discount’s code
name varchar 100 Discount’s name
descriptions text discount’s description
start_date date Start date applied
discount

end_date date The last day applied


discounts
decrease float discount value
order_total decimal 10 Minimum order price to
apply discount
created_at timestamp The time that the
discount was created
status int discount’s status

9.servings:
Field Name Data type Width Description

id int Auto increment Serving’s id


name varchar 255 Serving’s name
thumbnail varchar 255 Serving’s thumbnail
category_id int Id of table
serving_categories
type int Serving type

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 9


descriptions text Serving’s description

quantity int Quantity of servings


quantity_sold int Number of serving sold
price decimal 10 Serving’s price
is_new int Show serving that new
or not
Id_best_seller int Show serving that best
seller or not
created_at timestamp The time that the
serving was created
status int serving’s status

10.attributes:
Field Name Data type Width Description

id int Auto increment attribute’s ID


name varchar 100 attribute's name
parent_id int Id of parent attribute
created_at timestamp The time that the
attribute dewas created
11.serving_attributes:
Field Name Data type Width Description

id int Auto increment Serving attribute ID


serving_id int Serving’s id
attribute_id int Attribute’s
quantity int Serving attribute
quantity
price decimal 10 Serving attribute price
created_at timestamp The time that the
serving attribute was
created

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 10


12.serving_categories:
Field Name Data type Width Description

id int Auto increment Serving category ID


name varchar 150 Serving category name
Thumbnail Varchar 255 Serving category
thumbnail
Parent_id int Id of serving category
parent
created_at timestamp The time that the
serving category was
created
Status Int Serving category status

13.serving_image:
Field Name Data type Width Description

id int Auto increment Serving image ID


Serving_id Varchar 255 Serving’s id
path int Serving image path
created_at timestamp The time that the
serving image was
created
Status Int Serving image status

14.orders:
Field Name Data type Width Description

id int Auto increment Order’s id

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 11


code Varchar 20 Order’s code
table_id int Id of table
reservation_id Int Id of reservation
tip decimal 10 Customer tip for waiter
discount Decimal 10 Discount of the order
total_amount Decimal 10 Total of the order
payment_method Varchar Payment method of the
order
user_id Int Id of the waiter
created_at timestamp The time that the order
was created
status int Status of the order
15.order_details:
Field Name Data type Width Description

Id int Auto increment Id of the order


details
order_id int Order’s id
serving_id int Serving’s id
size varchar 50 Size of serving
serving_note text not of the serving
serving_status int serving’s status
quantity int serving’s quantity
price decimal 10 serving’s price
ice varchar 50 attribute of serving
sugar varchar 50 attribute of serving
total decimal 10 total of serving
user_id int id of the chef
created_at datetime the time that the
order was created

16.invoices:

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 12


Field Name Data type Width Description

id int Auto increment invoice’s id


code Varchar 20 invoice’s code
order_id int order’s id
payment_status Int Id of payment method
created_at timestamp the time that the invoice
was created

17.payment_method:
Field Name Data type Width Description

id int Auto increment id of the payment


method
code Varchar 20 code of the payment
method
name varchar 100 name of the payment
method
created_at timestamp the time that the
payment method was
created
status int Status of the payment
method

18.review_order:
Field Name Data type Width Description

id int Auto increment id of the review


order_id int order’s id
rate int rate of customer for the
order
comment text comment of customer
for that order
created_at timestamp the time that the review

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 13


was created

19.review_serving:
Field Name Data type Width Description

id int Auto increment id of the review


order_id int order’s id
serving_id int serving’s id
rate int rate of customer for the
order
comment text comment of customer
for that order
created_at timestamp the time that the review
was created

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 14


VALIDATIONS PERFORMED

Database Name:mal_de_puerco
1.users:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update table
statement
name not null clause in the create, update table
statement
code must be unique not null clause in the create, update table
statement
phone must be unique not null clause in the create, update table
statement
Vietnamese phone number constraint
password Encrypt with Bcrypt
email must be unique not null clause in the create, update table
statement
email format constraint (ex: abc@ok.vn ,
abc@gmail.vn)
role_id foreign key references roles(id) constraint

not null clause in the create, update table


statement
created_at default: CURRENT_TIMESTAMP

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 15


status default: 1

2.roles:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
code must be unique not null clause in the create, update
table statement
name must be unique not null clause in the create, update
table statement
created_at default: CURRENT_TIMESTAMP
status default 1

3.permissions:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update table
statement
code must be unique not null clause in the create, update table
statement
name must be unique not null clause in the create, update table
statement
created_at default: CURRENT_TIMESTAMP
status default 1

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 16


4.role_permissions:
Validation Required Method Used For Validation

id must be unique primary key constraint


not null clause in the create, update
table statement
role_id foreign key references roles(id)
constraint

not null clause in the create, update


table statement
permission_id foreign key references permissions(id)
constraint

not null clause in the create, update


table statement
created_at default: CURRENT_TIMESTAMP

5.tables:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
code must be unique not null clause in the create, update
table statement
name must be unique not null clause in the create, update
table statement
seats not null clause in the create, update
table statement
is_set default 0

user_id foreign key references users(id)


constraint

default 0
created_at default: CURRENT_TIMESTAMP
status default 1

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 17


6.reservations:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
code must be unique not null clause in the create, update
table statement
customer_name not null clause in the create, update
table statement
phone not null clause in the create, update
table statement
email not null clause in the create, update
table statement
date_pick date constraint
not null clause in the create, update
table statement
seats_pick not null clause in the create, update
table statement
start_time time constraint (hh:mm:ss)
not null clause in the create, update
table statement
end_time time constraint(hh:mm:ss)
not null clause in the create, update
table statement
created_at default: CURRENT_TIMESTAMP
status default 1

7.tables_reservation:
Validation Required Method Used For Validation

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 18


id must be unique primary key constraint
not null clause in the create, update
table statement
table_id foreign key references tables(id)
constraint

not null clause in the create, update


table statement
reservation_id foreign key references reservations(id)
constraint

not null clause in the create, update


table statement
created_at default: CURRENT_TIMESTAMP
status default 1

8.discounts:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
code must be unique not null clause in the create, update
table statement
name not null clause in the create, update
table statement
start_date date constraint
not null clause in the create, update
table statement
end_date date constraint
not null clause in the create, update
table statement

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 19


decrease default 0
created_at default: CURRENT_TIMESTAMP
status default: 1

9.servings:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
name not null clause in the create, update
table statement
thumbnail not null clause in the create, update
table statement
category_id foreign key references
serving_categories(id) constraint

not null clause in the create, update


table statement
type not null clause in the create, update
table statement
descriptions not null clause in the create, update
table statement
quantity not null clause in the create, update
table statement
quantity_sold not null clause in the create, update
table statement
is_new default 0
Id_best_seller default 0
created_at default: CURRENT_TIMESTAMP
status default: 1

10.attributes:

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 20


Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
name not null clause in the create, update
table statement
parent_id not null clause in the create, update
table statement
created_at default: CURRENT_TIMESTAMP
11.serving_attributes:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
serving_id foreign key references servings(id)
constraint

not null clause in the create, update


table statement
attribute_id foreign key references attributes(id)
constraint

not null clause in the create, update


table statement
created_at default: CURRENT_TIMESTAMP
12.serving_categories:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
name not null clause in the create, update
table statement
Thumbnail not null clause in the create, update
table statement
Parent_id not null clause in the create, update
table statement
created_at default: CURRENT_TIMESTAMP

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 21


Status default 1

13.serving_image:
Validation Required Method Used For Validation

id must be unique primary key constraint


not null clause in the create, update
table statement
Serving_id foreign key references servings(id)
constraint

not null clause in the create, update


table statement
path not null clause in the create, update
table statement
created_at default: CURRENT_TIMESTAMP
Status default 1

14.orders:
Validation Required Method Used For Validation
id must be unique primary key constraint
not null clause in the create, update
table statement
code must be unique not null clause in the create, update
table statement
table_id foreign key references tables(id)
constraint

not null clause in the create, update


table statement
reservation_id foreign key references reservations(id)
constraint

default 0
total_amount not null clause in the create, update
table statement
payment_method not null clause in the create, update
table statement

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 22


user_id foreign key references users(id)
constraint

not null clause in the create, update


table statement
created_at default: CURRENT_TIMESTAMP
status default 1
15.order_details:
Validation Required Method Used For Validation

Id must be unique primary key constraint


not null clause in the create, update
table statement
order_id foreign key references orders(id) constraint

not null clause in the create, update


table statement
serving_id foreign key references servings(id)
constraint

not null clause in the create, update


table statement
serving_status default 0
quantity not null clause in the create, update
table statement
price not null clause in the create, update
table statement
total not null clause in the create, update
table statement
user_id foreign key references users(id) constraint
not null clause in the create, update
table statement
created_at default: CURRENT_TIMESTAMP

16.invoices:
Validation Required Method Used For Validation

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 23


id must be unique primary key constraint
not null clause in the create, update
table statement
code must be unique not null clause in the create, update
table statement
order_id foreign key references orders(id)
constraint

not null clause in the create, update


table statement
payment_status default 0
created_at default: CURRENT_TIMESTAMP

17.payment_method:
Validation Required Method Used For Validation

id must be unique primary key constraint


not null clause in the create, update
table statement
code must be unique not null clause in the create, update
table statement
name not null clause in the create, update
table statement
created_at default: CURRENT_TIMESTAMP
status default 1

18.review_order:
Validation Required Method Used For Validation

id must be unique primary key constraint


not null clause in the create, update
table statement
order_id foreign key references orders(id)
constraint not null clause in the

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 24


create, update table statement
created_at default: CURRENT_TIMESTAMP

19.review_serving:
Validation Required Method Used For Validation

id must be unique primary key constraint


not null clause in the create, update
table statement
order_id foreign key references orders(id)
constraint

not null clause in the create, update


table statement
serving_id foreign key references servings(id)
constraint

not null clause in the create, update


table statement
created_at default: CURRENT_TIMESTAMP

DATA FLOW DIAGRAM

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 25


Data Flow Diagram representing the control flow of Project Case Study.

(WEB/WINDOWS) FORMS OUTLINE

Forms Name Description

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 26


Customer main view - Customer main view
containing categories/
subcategories, food &
drinks
- Order list
-Search box
- Button add

Custom products - Click button add to show


food & drink custom view
- Custom size, note,
quantity, sugar, ice
- Button done

Order list- Place vs Order list - pay - Place: click button done to
add products to order list
then press button place to
officially create order
- Pay: After order is placed,
repeat step above to add
more items to the list;
customer requesting
payment shall click button
pay

Request payment - After click button pay, this


view is shown, then select
payment
method(cash/momo)
- If total order amount
reaches minimum one set,
relevant discounts would be
shown
- Customer has deposit shall

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 27


select the check box and fill
in reservation phone
number
- Add some tip to order as
wish
- Then press button pay
with momo

Momo successful payment - After payment with momo


is successful, momo
application returns
confirmation and order
change status to complete
- Then show review order
form

Review order - Rate and review order

Sign in - Sign in as assigned role to


view and manage relative
views
- Check box remember
password for later sign in
- Button sign in

Chef order view - Role chef signs in to view,


update status of food &
drinks

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 28


Waiter order view - Role waiter signs in to
view, update status of orders
and order details

Categories - Any role assigned to


category management is
able to view, update, delete,
create categories with
corresponding assigned
permissions

Attributes - Any role assigned to


attribute management is
able to view, update, delete,
create attributes with
corresponding assigned
permissions

Users - Any role assigned to user


management is able to view,
update, delete, create users
with corresponding assigned
permissions

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 29


Tables - Any role assigned to table
management is able to view,
update, delete, create tables
with corresponding assigned
permissions

Reservation - Any role assigned to


reservation management is
able to view, update, delete,
create reservations with
corresponding assigned
permissions

Table setting - Set table configuration for


application/tablet

Account profile - Users view/update their


profile and change password

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 30


Roles & permissions - Administrator assigns
roles and permissions

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 31


CONFIGURATION

Software & Technology Used:


Software:
- Eclipse
- Mysql
- Scene Builder, gitbash
Technology:
- MVC model
- AWS
- Momo e-wallet
- Socket
- JavaFx, Java
- Github

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 32


PROJECT TIMELINES

S.No. Task to be performed Time

1. Database design - Gather relevant objects - 3 days


included in, define their
relationships, data types
- Implement Amazon RDB
to store shared database
2. MVC source code - Organize source code by -1 day
structure, store project on models, controllers and
git views besides helper classes
and referent libraries
- Git management
3. Customer-side features, - Design layouts - 14 days
layouts - Load products to
customer view by
categories / subcategories;
search products by name
- View and custom food
and drinks by size, sugar
and ice amount; set
quantity and leave note
before add to order
- Add and place order,
update order, send and
receive notifications to
servers, chefs using socket
- Process payment by cash
and Momo, check for
discount, deposit amount to
exclude from total order
amount, add tip to order
- QR code screening for
Momo e-wallet payment
- Review order after
finishing order payment
- Gather parts of project
into unified flow
4. Administrator-side - Log in, log out
features management()
- User management()
- Category management()
- Attribute management()
- Food & drinks

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 33


management()
- Order management()
- Reservation
management()
- Table management()
- Discount management()
- Roles & permissions()

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 34


INDIVIDUAL PROJECT SCHEDULE

S.No. Activity Description Responsibility


1. - Gather relevant objects included in, define Nguyen Huu Quynh
their relationships, data types Nhu
- Implement Amazon RDB to store shared
database
2. - Organize source code by models, controllers Nguyen Huu Quynh
and views besides helper classes and referent Nhu
libraries
- Git management
3. - Design layouts Nguyen Huu Quynh
- Load products to customer view by Nhu
categories / subcategories; search products by
name
- View and custom food and drinks by size,
sugar and ice amount; set quantity and leave
note before add to order
- Add and place order, update order, send and
receive notifications to servers, chefs using
socket
- Process payment by cash and Momo, check
for discount, deposit amount to exclude from
total order amount, add tip to order
- QR code screening for Momo e-wallet
payment
- Review order after finishing order payment
- Gather parts of project into unified flow
4. -Build layouts (users, assign permission, role, Vo Huynh Ngoc Tram
tables, reservation, schedule of tables,
schedule of reservations, discount, layout
created,update of the above layout listed)
5. -Build functions (create, update, detele, view Vo Huynh Ngoc Tram
data) of users, assign permission, role, tables,
reservation, schedule of tables, schedule of
reservations, discount
6. - Encrypt with Bcrypt Vo Huynh Ngoc Tram
- Remember log in when checked in the
checkbox
-Role permissions for all users
-Super admin can’t delete your roles
-Users and super admin can’t update your
status in this application
-Manager can’t see super admin on users view
-Server,manager,admin can set code for tablet
to know which orders are sent from the table

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 35


-Remember table code when server, manager,
admin has set up
- Users can rely on the schedule to advise
customers who want to book a table, while
creating it, if you enter enough information, it
will load which tables are available in that
time for users to choose
- Users can set the time customer can cancel
the reservation and specify the reservation set
time(ex: only canceled within 2 hours, only set
a table after 2 hours now)

ACE-HCMC-6-APROTRAIN - 212 -214 NGUYEN DINH CHIEU ST, DISTRICT 3, HCMC 36

You might also like