-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from Xaptured/ESA-028
Added teams table along with code flows
- Loading branch information
Showing
14 changed files
with
675 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
src/main/java/com/thejackfolio/microservices/thejackfolio_db/entities/TeamDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Copyright (c) 2023. | ||
* Created this for the project called "TheJackFolio" | ||
* All right reserved by Jack | ||
*/ | ||
|
||
package com.thejackfolio.microservices.thejackfolio_db.entities; | ||
|
||
import jakarta.persistence.*; | ||
|
||
import java.util.Objects; | ||
|
||
@Entity | ||
@Table(name = "team_details") | ||
public class TeamDetails { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
private Integer id; | ||
@Column(name = "email") | ||
private String email; | ||
@Column(name = "team_id") | ||
private Integer teamId; | ||
@Column(name = "player_number") | ||
private Integer playerNumber; | ||
|
||
public TeamDetails() { | ||
} | ||
|
||
public TeamDetails(Integer id, String email, Integer teamId, Integer playerNumber) { | ||
this.id = id; | ||
this.email = email; | ||
this.teamId = teamId; | ||
this.playerNumber = playerNumber; | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public Integer getTeamId() { | ||
return teamId; | ||
} | ||
|
||
public void setTeamId(Integer teamId) { | ||
this.teamId = teamId; | ||
} | ||
|
||
public Integer getPlayerNumber() { | ||
return playerNumber; | ||
} | ||
|
||
public void setPlayerNumber(Integer playerNumber) { | ||
this.playerNumber = playerNumber; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TeamDetails that = (TeamDetails) o; | ||
return Objects.equals(id, that.id) && Objects.equals(email, that.email) && Objects.equals(teamId, that.teamId) && Objects.equals(playerNumber, that.playerNumber); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, email, teamId, playerNumber); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TeamDetails{" + | ||
"id=" + id + | ||
", email='" + email + '\'' + | ||
", teamId=" + teamId + | ||
", playerNumber=" + playerNumber + | ||
'}'; | ||
} | ||
} |
93 changes: 93 additions & 0 deletions
93
src/main/java/com/thejackfolio/microservices/thejackfolio_db/entities/Teams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright (c) 2023. | ||
* Created this for the project called "TheJackFolio" | ||
* All right reserved by Jack | ||
*/ | ||
|
||
package com.thejackfolio.microservices.thejackfolio_db.entities; | ||
|
||
import com.thejackfolio.microservices.thejackfolio_db.enums.TeamStatus; | ||
import jakarta.persistence.*; | ||
|
||
import java.util.Objects; | ||
|
||
@Entity | ||
@Table(name = "teams") | ||
public class Teams { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
private Integer id; | ||
@Column(name = "name") | ||
private String name; | ||
@Column(name = "event_id") | ||
private Integer eventId; | ||
@Column(name = "status") | ||
private TeamStatus teamStatus; | ||
|
||
public Teams() { | ||
} | ||
|
||
public Teams(Integer id, String name, Integer eventId, TeamStatus teamStatus) { | ||
this.id = id; | ||
this.name = name; | ||
this.eventId = eventId; | ||
this.teamStatus = teamStatus; | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Integer getEventId() { | ||
return eventId; | ||
} | ||
|
||
public void setEventId(Integer eventId) { | ||
this.eventId = eventId; | ||
} | ||
|
||
public TeamStatus getTeamStatus() { | ||
return teamStatus; | ||
} | ||
|
||
public void setTeamStatus(TeamStatus teamStatus) { | ||
this.teamStatus = teamStatus; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
Teams teams = (Teams) o; | ||
return Objects.equals(id, teams.id) && Objects.equals(name, teams.name) && Objects.equals(eventId, teams.eventId) && teamStatus == teams.teamStatus; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, name, eventId, teamStatus); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Teams{" + | ||
"id=" + id + | ||
", name='" + name + '\'' + | ||
", eventId=" + eventId + | ||
", teamStatus=" + teamStatus + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
|
||
public enum EventStatus { | ||
|
||
INACTIVE, ACTIVE, COMPLETED; | ||
INACTIVE, ACTIVE, ONGOING, COMPLETED; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/thejackfolio/microservices/thejackfolio_db/enums/TeamStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2023. | ||
* Created this for the project called "TheJackFolio" | ||
* All right reserved by Jack | ||
*/ | ||
|
||
package com.thejackfolio.microservices.thejackfolio_db.enums; | ||
|
||
public enum TeamStatus { | ||
|
||
FREE, PENDING, PAID; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/thejackfolio/microservices/thejackfolio_db/exceptions/TeamException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) 2023. | ||
* Created this for the project called "TheJackFolio" | ||
* All right reserved by Jack | ||
*/ | ||
|
||
package com.thejackfolio.microservices.thejackfolio_db.exceptions; | ||
|
||
public class TeamException extends Exception{ | ||
|
||
public TeamException(String message) { | ||
super(message); | ||
} | ||
} |
Oops, something went wrong.