JDK 17: This project used JDK 17 for development: https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html
Installing maven: https://maven.apache.org/download.cgi
Build with maven: mvn -B package --file teamproject/pom.xml
Running the application: mvn spring-boot:run -D"spring-boot.run.arguments=setup"
Running the test: mvn clean test
Check the test coverage report inside teamproject folder: mvn jacoco:report. The report path will be ./target/site/jacoco/index.html
Running the style checker inside teamproject folder: mvn checkstyle:check
- Controller (API endpoints)
- Service (business logic)
- repository
- DB models
• Expected Input: recurrence(string but should match to daily, weekly, monthly, none)
• Expected Output: the meeting matched with the recurrence
• Upon Success: HTTP 200 Status Code is returned along with the participant in the response body
• Expected Input: type(string but should match to group, one_on_one)
• Expected Output: the meeting matched with the type
• Upon Success: HTTP 200 Status Code is returned along with the participant in the response body
• Expected Input: id(int)
• Expected Output: the meeting matched with the id
• Upon Success: HTTP 200 Status Code is returned along with the participant in the response body
• Expected Input: N/A.
• Expected Output: All meetings in descending order in JSON
• Upon Success: HTTP 200 Status Code is returned along with all participants in the response body
• Expected Input: organizer(user in JSON type).
• Expected Output: All meetings matched with the organizer
• Upon Success: HTTP 200 Status Code is returned along with all participants in the response body
• Expected Input: meetingID(meeting in JSON type).
• Expected Output: A complete meeting object delete
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: meeting(meeting in JSON type).
• Expected Output: A complete meeting object saved
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: a participant object in JSON.
• Expected Output: the complete participant object added
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: a participant id.
• Expected Output: a participant has been deleted
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: id(int).
• Expected Output: the participant matched the input id
• Upon Success: HTTP 200 Status Code is returned along with the participant in the response body
• Expected Input: N/A.
• Expected Output: All participant in descending order in JSON
• Upon Success: HTTP 200 Status Code is returned along with all participants in the response body
• Expected Input: meeting(meeting in JSON).
• Expected Output: All participant in JSON
• Upon Success: HTTP 200 Status Code is returned along with all participants in the response body
• Expected Input: user(user in JSON).
• Expected Output: All participant in JSON
• Upon Success: HTTP 200 Status Code is returned along with all participants in the response body
• Expected Input: status(undecided, approved, rejected).
• Expected Output: All participant in JSON
• Upon Success: HTTP 200 Status Code is returned along with all participants in the response body
• Expected Input: role(participant, organizer).
• Expected Output: All participant in JSON
• Upon Success: HTTP 200 Status Code is returned along with all participants in the response body
• Expected Input: a timeslot object in JSON.
• Expected Output: the complete user object added
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: id(int).
• Expected Output: the time slot matched the ID
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: N/A.
• Expected Output: all time slots in the descending order
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: id(int).
• Expected Output: all time slot matched the input user id
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: day(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday).
• Expected Output: all time slot matched the input day
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: availability(available, busy).
• Expected Output: all time slot matched the input availability
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: id(int), timeslot (timeslot in JSON).
• Expected Output: update the time slot given the tid
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: id(int)
• Expected Output: delete the time slot given the tid
• Upon Success: HTTP 200 Status Code is returned
• Expected Input: a user object in JASON.
• Expected Output: the complete user object added
• Upon Success: HTTP 200 Status Code is returned along with the user in the response body
• Expected Input: name(String).
• Expected Output: the list of users matched with the input name
• Upon Success: HTTP 200 Status Code is returned along with the users in the response body
• Expected Input: Id(int).
• Expected Output: the user matched with the input ID
• Upon Success: HTTP 200 Status Code is returned along with the user in the response body
• Expected Input: email(String).
• Expected Output: the list of users matched with the input email
• Upon Success: HTTP 200 Status Code is returned along with the users in the response body
• Expected Input: N/A
• Expected Output: All users in the descending order
• Upon Success: HTTP 200 Status Code is returned along with the users in the response body
• Expected request body: a request object in JSON.
{
"user": {
"uid": 1
},
"timeSlot": {
"tid": 2
},
"description": "Request 3",
"status": "undecided"
}
• Expected Output: the complete request object added
• Upon Success: HTTP 200 Status Code is returned along with the request in the response body
• Expected Input Parameters: tid (int) or requesterId (int)
• Expected Output: all requests with the given tid or rerquesterId
• Upon Success: HTTP 200 Status Code is returned along with the request in the response body
• Upon Failure: If no parameter is presented will return HTTP 400 status code with message: Invalid request: Please provide either 'userid' or 'tid'
• Expected Input Parameters: N/A
• Expected Output: The request object that has the given tid and uid.
• Expected Input Parameters: tid (int) and userid (int)
• Expected request body: a string representing the new description.
• Expected Output: The request object that has been updated.
• Expected Input Parameters: tid (int) and userid (int)
• Expected request body: a string representing the new status.
• Expected Output: The request object that has been updated.
• Expected Input Parameters: tid (int) and userid (int)
• Expected Output: HTTP 200 status code.
Participant Table:
CREATE TABLE Participant (
PID INT NOT NULL AUTO_INCREMENT,
MID INT NOT NULL,
UID INT NOT NULL,
role ENUM('participant', 'organizer') DEFAULT NULL,
join_at TIMESTAMP DEFAULT NULL,
status ENUM('decline', 'accept', 'waiting') DEFAULT NULL,
PRIMARY KEY (PID),
FOREIGN KEY (UID) REFERENCES User(UID),
FOREIGN KEY (MID) REFERENCES Meeting(MID)
);
Meeting table:
CREATE TABLE Meeting (
MID INT NOT NULL AUTO_INCREMENT,
organizer_id INT NOT NULL,
type ENUM('group', 'one_on_one') DEFAULT NULL,
description TEXT DEFAULT NULL,
start_time TIMESTAMP DEFAULT NULL,
end_time TIMESTAMP DEFAULT NULL,
recurrence ENUM('daily', 'weekly', 'monthly', 'none') DEFAULT NULL,
created_at TIMESTAMP DEFAULT NULL,
num_invite_participant INT DEFAULT NULL,
num_accept_participant INT DEFAULT NULL,
status ENUM('Valid', 'Invalid') DEFAULT NULL,
PRIMARY KEY (MID),
FOREIGN KEY (organizer_id) REFERENCES User(UID)
);
User table:
CREATE TABLE User (
UID INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) DEFAULT NULL,
email VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (UID)
);
TimeSlot table:
CREATE TABLE TimeSlot (
TID INT AUTO_INCREMENT PRIMARY KEY,
UID INT DEFAULT NULL,
day ENUM('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday') DEFAULT NULL,
start_time TIME DEFAULT NULL,
end_time TIME DEFAULT NULL,
availability ENUM('available', 'busy') DEFAULT NULL
FOREIGN KEY (UID) REFERENCES User(UID)
);
Generate all tables:
CREATE TABLE User (
UID INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) DEFAULT NULL,
email VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (UID)
);
CREATE TABLE TimeSlot (
TID INT AUTO_INCREMENT PRIMARY KEY,
UID INT DEFAULT NULL,
day ENUM('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday') DEFAULT NULL,
start_time TIME DEFAULT NULL,
end_time TIME DEFAULT NULL,
availability ENUM('available', 'busy') DEFAULT NULL,
FOREIGN KEY (UID) REFERENCES User(UID)
);
CREATE TABLE Meeting (
MID INT NOT NULL AUTO_INCREMENT,
organizer_id INT NOT NULL,
type ENUM('group', 'one_on_one') DEFAULT NULL,
description TEXT DEFAULT NULL,
start_time TIMESTAMP DEFAULT NULL,
end_time TIMESTAMP DEFAULT NULL,
recurrence ENUM('daily', 'weekly', 'monthly', 'none') DEFAULT NULL,
created_at TIMESTAMP DEFAULT NULL,
num_invite_participant INT DEFAULT NULL,
num_accept_participant INT DEFAULT NULL,
status ENUM('Valid', 'Invalid') DEFAULT NULL,
PRIMARY KEY (MID),
FOREIGN KEY (organizer_id) REFERENCES User(UID)
);
CREATE TABLE Participant (
PID INT NOT NULL AUTO_INCREMENT,
MID INT NOT NULL,
UID INT NOT NULL,
role ENUM('participant', 'organizer') DEFAULT NULL,
join_at TIMESTAMP DEFAULT NULL,
status ENUM('decline', 'accept', 'waiting') DEFAULT NULL,
PRIMARY KEY (PID),
FOREIGN KEY (UID) REFERENCES User(UID),
FOREIGN KEY (MID) REFERENCES Meeting(MID)
);
CREATE TABLE Request (
requesterID INT NOT NULL,
TID INT NOT NULL,
description VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (requesterID, TID),
FOREIGN KEY (requesterID) REFERENCES User(UID),
FOREIGN KEY (TID) REFERENCES TimeSlot(TID)
);
ALTER TABLE Request
ADD status ENUM('undecided', 'approved', 'rejected') NOT NULL DEFAULT 'undecided';
Used the tool "checkstyle" to check the style of the code:
Used JaCoCo to perform branch analysis to see the test coverage.
Maven Package Manager
GitHub Actions CI
Checkstyle
PMD
JUnit
JaCoCo
Postman