Skip to content
Snippets Groups Projects
Commit ee2666ad authored by Ada Turgut's avatar Ada Turgut
Browse files

refactoring classes

parent d5d1c018
Branches
No related tags found
1 merge request!55Resolve "Implement cache schema"
Pipeline #1266658 failed
Showing
with 474 additions and 296 deletions
package nl.tudelft.gitbull.model.statistics;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import java.time.OffsetDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Contribution {
@Id
private Long id;
private Long authorId;
@ManyToOne
private Project project;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@Lob
private String content;
/* JSON STRUCTURE
{
# of commits,
LOC: {
# of lines added,
# of lines deleted,
# of lines modified,
# of lines survived}
epics: [epic id, # of comments made in the epic, # of issues done in that epic]}
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.model.statistics;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ContributionStatistics {
@Id
private Long id;
private Long authorId;
@ManyToOne
private ProjectStatistics projectStatistics;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@Lob
private String content;
/* JSON STRUCTURE
{
# of commits,
LOC: {
# of lines added,
# of lines deleted,
# of lines modified,
# of lines survived}
epics: [epic id, # of comments made in the epic, # of issues done in that epic]}
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
package nl.tudelft.gitbull.model.statistics;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.OneToOne;
import java.time.OffsetDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import nl.tudelft.gitbull.model.GitbullGroup;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Group {
@Id
private Long id;
@OneToOne
private GitbullGroup group;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAfter;
@Lob
private String content;
/* JSON Structure
{
hours of day: [
08-10 -> # of commits made,
10-17 -> # of commits made,
17-00 -> # of commits made,
00-08 -> # of commits made],
epics : [epic id -> name of epic]}
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.model.statistics;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.OneToOne;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import nl.tudelft.gitbull.model.GitbullGroup;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class GroupStatistics {
@Id
private Long id;
@OneToOne
private GitbullGroup group;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAfter;
@Lob
private String content;
/* JSON Structure
{
hours of day: [
08-10 -> # of commits made,
10-17 -> # of commits made,
17-00 -> # of commits made,
00-08 -> # of commits made],
epics : [epic id -> name of epic]}
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
package nl.tudelft.gitbull.model.statistics;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import java.time.OffsetDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Issue {
@Id
private Long id;
@ManyToOne
private Project project;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime createdAt;
@Lob
private String content;
/*
JSON STRUCTURE:
{
state,
assignee_id,
weight,
time_stats : {time_estimate, total_time_spent},
comments: [{assignee_id , length of comment, created_at, deleted_at }]
}
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.model.statistics;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class IssueStatistics {
@Id
private Long id;
@ManyToOne
private ProjectStatistics projectStatistics;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime createdAt;
@Lob
private String content;
/*
JSON STRUCTURE:
{
state,
assignee_id,
weight,
time_stats : {time_estimate, total_time_spent},
comments: [{assignee_id , length of comment, created_at, deleted_at }]
}
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.model.statistics;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class MRStatistics {
@Id
@NotNull
private Long id;
@ManyToOne
private ProjectStatistics projectStatistics;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime createdAt;
@Lob
private String content;
/* JSON structure:
{
author_id,
state,
labels,
approvals_before_merge
comments: [{assignee_id , length of comment, created_at, deleted_at }]
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
package nl.tudelft.gitbull.model.statistics;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import jakarta.validation.constraints.NotNull;
import java.time.OffsetDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class MergeRequest {
@Id
@NotNull
private Long id;
@ManyToOne
private Project project;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime createdAt;
@Lob
private String content;
/* JSON structure:
{
author_id,
state,
labels,
approvals_before_merge
comments: [{assignee_id , length of comment, created_at, deleted_at }]
*/
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
package nl.tudelft.gitbull.model.statistics;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import java.time.OffsetDateTime;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Project {
@Id
private Long id;
@ManyToOne
private Group group;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAfter;
@Lob
private String content;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.model.statistics;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ProjectStatistics {
@Id
private Long id;
@ManyToOne
private GroupStatistics groupStatistics;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private OffsetDateTime updatedAfter;
@Lob
private String content;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
package nl.tudelft.gitbull.repository.statistics;
import nl.tudelft.gitbull.model.statistics.Contribution;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ContributionRepository extends JpaRepository<Contribution, Long> {
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.repository.statistics;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import nl.tudelft.gitbull.model.statistics.ContributionStatistics;
@Repository
public interface ContributionStatisticsRepository extends JpaRepository<ContributionStatistics, Long> {
}
package nl.tudelft.gitbull.repository.statistics;
import nl.tudelft.gitbull.model.statistics.Group;
import org.springframework.data.jpa.repository.JpaRepository;
public interface GroupRepository extends JpaRepository<Group, Long> {
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.repository.statistics;
import org.springframework.data.jpa.repository.JpaRepository;
import nl.tudelft.gitbull.model.statistics.GroupStatistics;
public interface GroupStatisticsRepository extends JpaRepository<GroupStatistics, Long> {
}
package nl.tudelft.gitbull.repository.statistics;
import nl.tudelft.gitbull.model.statistics.Issue;
import org.springframework.data.jpa.repository.JpaRepository;
public interface IssueRepository extends JpaRepository<Issue, Long> {
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.repository.statistics;
import org.springframework.data.jpa.repository.JpaRepository;
import nl.tudelft.gitbull.model.statistics.IssueStatistics;
public interface IssueStatisticsRepository extends JpaRepository<IssueStatistics, Long> {
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.repository.statistics;
import org.springframework.data.jpa.repository.JpaRepository;
import nl.tudelft.gitbull.model.statistics.MRStatistics;
public interface MRStatisticsRepository extends JpaRepository<MRStatistics, Long> {
}
package nl.tudelft.gitbull.repository.statistics;
import nl.tudelft.gitbull.model.statistics.MergeRequest;
import org.springframework.data.jpa.repository.JpaRepository;
public interface MergeRequestRepository extends JpaRepository<MergeRequest, Long> {
}
package nl.tudelft.gitbull.repository.statistics;
import nl.tudelft.gitbull.model.statistics.Project;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ProjectRepository extends JpaRepository<Project, Long> {
}
/*
* GitBull
* Copyright (C) 2023 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.gitbull.repository.statistics;
import org.springframework.data.jpa.repository.JpaRepository;
import nl.tudelft.gitbull.model.statistics.ProjectStatistics;
public interface ProjectStatisticsRepository extends JpaRepository<ProjectStatistics, Long> {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment