Skip to content

Commit

Permalink
Merge pull request #175 from Devansh-bit/status_remark_dev
Browse files Browse the repository at this point in the history
Added status_remark field to the Project model
  • Loading branch information
harshkhandeparkar authored Dec 17, 2023
2 parents 97f0216 + fdc1809 commit 05af937
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ The `models/` directory contains database models for the KWoC database tables. (
- `comm_channel` (string): A link to the project's official communication channel.
- `readme_link` (string): A link to the project's README file.
- `project_status` (bool): Whether the project is approved.
- `status_remark` (string): Message that states the reason for rejection/suggested changes for project approval
- `last_pull_time` (int64): The timestamp of merging the last tracked pull request (for statistics).
- `commit_count` (uint): The number of commits contributed to this project during KWoC.
- `pull_count` (uint): The number of pull requests contributed to this project during KWoC.
Expand Down
2 changes: 2 additions & 0 deletions controllers/mentor.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ProjectInfo struct {
ReadmeLink string `json:"readme_link"`
Tags []string `json:"tags"`
ProjectStatus bool `json:"project_status"`
StatusRemark string `json:"status_remark"`

CommitCount uint `json:"commit_count"`
PullCount uint `json:"pull_count"`
Expand Down Expand Up @@ -200,6 +201,7 @@ func CreateMentorDashboard(mentor models.Mentor, db *gorm.DB) MentorDashboard {
ReadmeLink: project.ReadmeLink,
Tags: tags,
ProjectStatus: project.ProjectStatus,
StatusRemark: project.StatusRemark,

CommitCount: project.CommitCount,
PullCount: project.PullCount,
Expand Down
1 change: 1 addition & 0 deletions controllers/mentor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ func TestMentorDashboardOK(t *testing.T) {
ReadmeLink: p.ReadmeLink,
Tags: tags,
ProjectStatus: p.ProjectStatus,
StatusRemark: p.StatusRemark,

CommitCount: p.CommitCount,
PullCount: p.PullCount,
Expand Down
1 change: 1 addition & 0 deletions controllers/project_fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func generateTestProjects(numProjects int, randomizeProjectStatus bool, defaultP
CommChannel: fmt.Sprintf("https://link%d", rand.Int()),
ReadmeLink: fmt.Sprintf("https://readme%d", rand.Int()),
ProjectStatus: projectStatus,
StatusRemark: fmt.Sprintf("Status remark %d", rand.Int()),

// Stats
CommitCount: uint(rand.Int()),
Expand Down
1 change: 1 addition & 0 deletions models/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type Project struct {
CommChannel string `gorm:"column:comm_channel"`
ReadmeLink string `gorm:"column:readme_link"`
ProjectStatus bool `gorm:"default:false;column:project_status"`
StatusRemark string `gorm:"default:null;column:status_remark"`

// for stats
LastPullTime int64 `gorm:"column:last_pull_time"`
Expand Down

0 comments on commit 05af937

Please sign in to comment.