Skip to content

Commit

Permalink
Incorporate review findings + some frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
balintgrober committed Sep 4, 2023
1 parent aed21c1 commit 8f78232
Show file tree
Hide file tree
Showing 111 changed files with 2,191 additions and 617 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.4" />
</ItemGroup>

<ItemGroup>
<Folder Include="Helper\" />
</ItemGroup>

</Project>
6 changes: 1 addition & 5 deletions grade-management/Ahk.GradeManagement.Data/AhkDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ public AhkDbContext(DbContextOptions<AhkDbContext> options) : base(options) { }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<StudentAssignment>().HasKey(e => new { e.StudentId, e.AssignmentId });
modelBuilder.Entity<StudentGroup>().HasKey(e => new { e.StudentId, e.GroupId });
modelBuilder.Entity<StudentSubject>().HasKey(e => new { e.StudentId, e.SubjectId });
modelBuilder.Entity<TeacherGroup>().HasKey(e => new { e.TeacherId, e.GroupId });
modelBuilder.Entity<TeacherSubject>().HasKey(e => new { e.TeacherId, e.SubjectId });

}
}
}
17 changes: 0 additions & 17 deletions grade-management/Ahk.GradeManagement.Data/DataServiceBuilder.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Ahk.GradeManagement.Data.Entities
public class Assignment
{
public int Id { get; set; }
public int SubjectId { get; set; }
public string Name { get; set; }
public DateTime DeadLine { get; set; }
public DateTimeOffset DeadLine { get; set; }
public Uri ClassroomAssignment { get; set; }

public ICollection<Exercise> Exercises { get; set; }

Check warning on line 16 in grade-management/Ahk.GradeManagement.Data/Entities/Assignment.cs

View workflow job for this annotation

GitHub Actions / build

Change 'Exercises' to be read-only by removing the property setter (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227)

public int SubjectId { get; set; }
public Subject Subject { get; set; }
public Grade Grade { get; set; }
public ICollection<StudentAssignment> StudentAssignments { get; set; }

Check warning on line 21 in grade-management/Ahk.GradeManagement.Data/Entities/Assignment.cs

View workflow job for this annotation

GitHub Actions / build

Change 'StudentAssignments' to be read-only by removing the property setter (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ namespace Ahk.GradeManagement.Data.Entities
public class Exercise
{
public int Id { get; set; }
public int AssignmentId { get; set; }
public int AvailablePoints { get; set; }
public string Name { get; set; }


public int AssignmentId { get; set; }
public Assignment Assignment { get; set; }
public Point? Point { get; set; }

Check warning on line 20 in grade-management/Ahk.GradeManagement.Data/Entities/Exercise.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
}
Expand Down
11 changes: 6 additions & 5 deletions grade-management/Ahk.GradeManagement.Data/Entities/Grade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ public class Grade
public string GithubRepoName { get; set; }
public int GithubPrNumber { get; set; }
public Uri GithubPrUrl { get; set; }
public DateTime Date { get; set; }
public bool Confirmed { get; set; }
public Uri Origin { get; set; }
public DateTimeOffset Date { get; set; }
public bool IsConfirmed { get; set; }
public string Origin { get; set; }


public int AssignmentId { get; set; }
public int StudentId { get; set; }
public ICollection<Point> Points { get; set; }

Check warning on line 20 in grade-management/Ahk.GradeManagement.Data/Entities/Grade.cs

View workflow job for this annotation

GitHub Actions / build

Change 'Points' to be read-only by removing the property setter (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227)
public int AssignmentId { get; set; }
public Assignment Assignment { get; set; }
public int StudentId { get; set; }
public Student Student { get; set; }
}
}
2 changes: 2 additions & 0 deletions grade-management/Ahk.GradeManagement.Data/Entities/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class Group
public string Room { get; set; }
public string Time { get; set; }

public int SubjectId { get; set; }
public Subject Subject { get; set; }
public ICollection<StudentGroup> StudentGroups { get; set; }

Check warning on line 18 in grade-management/Ahk.GradeManagement.Data/Entities/Group.cs

View workflow job for this annotation

GitHub Actions / build

Change 'StudentGroups' to be read-only by removing the property setter (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227)
public ICollection<TeacherGroup> TeacherGroups { get; set; }

Check warning on line 19 in grade-management/Ahk.GradeManagement.Data/Entities/Group.cs

View workflow job for this annotation

GitHub Actions / build

Change 'TeacherGroups' to be read-only by removing the property setter (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227)
}
Expand Down
5 changes: 3 additions & 2 deletions grade-management/Ahk.GradeManagement.Data/Entities/Point.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ namespace Ahk.GradeManagement.Data.Entities
public class Point
{
public int Id { get; set; }
public int? GradeId { get; set; }
public int ExerciseId { get; set; }
public double PointEarned { get; set; }


public int ExerciseId { get; set; }
public Exercise Exercise { get; set; }
public int? GradeId { get; set; }
public Grade? Grade { get; set; }

Check warning on line 18 in grade-management/Ahk.GradeManagement.Data/Entities/Point.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace Ahk.GradeManagement.Data.Entities.StatusTracking
public class Assignee
{
public int Id { get; set; }
public int PullRequestEventId { get; set; }
public string GithubUser { get; set; }

public int PullRequestEventId { get; set; }
public PullRequestEvent PullRequestEvent { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class BranchCreateEvent : StatusEventBase
{
public const string TypeName = "BranchCreateEvent";

public override string Type { get => TypeName; set { } }
public override string Type { get => TypeName; }
public string Branch { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class PullRequestEvent : StatusEventBase
{
public const string TypeName = "PullRequestEvent";

public override string Type {get => TypeName; set { } }
public override string Type {get => TypeName; }
public string Action { get; set; }
public string Neptun { get; set; }
public string HtmlUrl { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public class RepositoryCreateEvent : StatusEventBase
{
public const string TypeName = "RepositoryCreateEvent";

public override string Type { get => TypeName; set { } }
public override string Type { get => TypeName; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class StatusEventBase
public string Repository { get; set; }


public abstract string Type { get; set; }
public abstract string Type { get; }
public DateTime Timestamp { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class WorkflowRunEvent : StatusEventBase
{
public const string TypeName = "WorkflowRunEvent";

public override string Type { get => TypeName; set { } }
public override string Type { get => TypeName; }
public string Conclusion { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ namespace Ahk.GradeManagement.Data.Entities
{
public class StudentAssignment
{
public int Id { get; set; }
public int StudentId { get; set; }
public int AssignmentId { get; set; }

public Student Student { get; set; }
public int AssignmentId { get; set; }
public Assignment Assignment { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ namespace Ahk.GradeManagement.Data.Entities
{
public class StudentGroup
{
public int Id { get; set; }
public int StudentId { get; set; }
public int GroupId { get; set; }

public Student Student { get; set; }
public int GroupId { get; set; }
public Group Group { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ namespace Ahk.GradeManagement.Data.Entities
{
public class StudentSubject
{
public int Id { get; set; }
public int StudentId { get; set; }
public int SubjectId { get; set; }

public Student Student { get; set; }
public int SubjectId { get; set; }
public Subject Subject { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ public class Subject
public string Semester { get; set; }
public string SubjectCode { get; set; }
public string GithubOrg { get; set; }
public string ahkConfig { get; set; }
public string AhkConfig { get; set; }

public ICollection<Assignment> Assignments { get; set; }
public ICollection<Group> Groups { get; set; }
public ICollection<StudentSubject> StudentSubjects { get; set; }
public ICollection<TeacherSubject> TeacherSubjects { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ahk.GradeManagement.Data.Enums;

namespace Ahk.GradeManagement.Data.Entities
{
public class Teacher : User
{
public string Role { get; set; }
public Role Role { get; set; }

public ICollection<TeacherSubject> TeacherSubjects { get; set; }
public ICollection<TeacherGroup> TeacherGroups { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ namespace Ahk.GradeManagement.Data.Entities
{
public class TeacherGroup
{
public int Id { get; set; }
public int TeacherId { get; set; }
public int GroupId { get; set; }

public Teacher Teacher { get; set; }
public int GroupId { get; set; }
public Group Group { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ namespace Ahk.GradeManagement.Data.Entities
{
public class TeacherSubject
{
public int Id { get; set; }
public int TeacherId { get; set; }
public int SubjectId { get; set; }

public Teacher Teacher { get; set; }
public int SubjectId { get; set; }
public Subject Subject { get; set; }
}
}
14 changes: 14 additions & 0 deletions grade-management/Ahk.GradeManagement.Data/Enums/Role.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ahk.GradeManagement.Data.Enums
{
public enum Role
{
Teacher,
Student
}
}
16 changes: 0 additions & 16 deletions grade-management/Ahk.GradeManagement.Data/IAssignmentRepository.cs

This file was deleted.

14 changes: 0 additions & 14 deletions grade-management/Ahk.GradeManagement.Data/IGradeRepository.cs

This file was deleted.

20 changes: 0 additions & 20 deletions grade-management/Ahk.GradeManagement.Data/IGroupRepository.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8f78232

Please sign in to comment.