-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement scheduling service #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MaximilianAnzinger
merged 22 commits into
main
from
feature/implement-scheduling-service
Feb 27, 2026
Merged
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
650775a
style: change font and polish UI
markstockhausen 79e45a2
style: update font weight
markstockhausen 430e1c2
style: conform to Prettier formatting
markstockhausen 73a402b
Implement optimized Scheduling Service and Pipeline Logic
markstockhausen 8850cf6
style: update comments
markstockhausen fe676c3
Implement AI suggestions
markstockhausen b199432
Update Axios, Optimise scheduling pipeline
markstockhausen 67d6e58
Optimise pipeline logic and clean up code
markstockhausen 60d7f66
Optimise pipeline
markstockhausen 6251a3a
Update logic for bidirectional relationship types
markstockhausen e683410
Streamline implementation
markstockhausen 141bebd
Conform to Prettier formatting
markstockhausen 64c4f20
Implement AI suggestions
markstockhausen d863e77
Further AI suggestions
markstockhausen 846fd3d
Merge branch 'main' into feature/implement-scheduling-service
markstockhausen a1ffb6f
Update scheduling logic
markstockhausen ef72e01
Fix undo edge case
markstockhausen 5786c58
Fix severities
markstockhausen cb45f20
Conform to Prettier formatting
markstockhausen 566dd19
Update swap logic
markstockhausen dea46d1
remove unused code
markstockhausen 83112f7
Remove later to be added DashboardPage
markstockhausen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains hidden or 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
44 changes: 44 additions & 0 deletions
44
server/src/main/java/de/tum/cit/memo/controller/SchedulingController.java
This file contains hidden or 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,44 @@ | ||
| package de.tum.cit.memo.controller; | ||
|
|
||
| import de.tum.cit.memo.dto.RelationshipTaskResponse; | ||
| import de.tum.cit.memo.dto.VoteRequest; | ||
| import de.tum.cit.memo.dto.VoteResponse; | ||
| import de.tum.cit.memo.service.SchedulingService; | ||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||
| import jakarta.validation.Valid; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RequestHeader; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/scheduling") | ||
| @RequiredArgsConstructor | ||
| @Tag(name = "Scheduling", description = "Endpoints for competency mapping scheduling") | ||
| public class SchedulingController { | ||
|
|
||
| private final SchedulingService schedulingService; | ||
|
|
||
| @GetMapping("/next-relationship") | ||
| @Operation(summary = "Get next relationship to vote on", description = "Returns a competency pair for the user to map. Uses coverage (70%) and consensus (30%) pipelines. Returns 204 if no tasks remain.") | ||
| public ResponseEntity<RelationshipTaskResponse> getNextRelationship( | ||
| @RequestHeader("X-User-Id") String userId) { | ||
| return schedulingService.getNextTask(userId) | ||
| .map(ResponseEntity::ok) | ||
| .orElse(ResponseEntity.noContent().build()); | ||
| } | ||
|
|
||
| @PostMapping("/vote") | ||
| @Operation(summary = "Submit a vote on a relationship", description = "Records the user's vote on a competency relationship. MATCHES votes are bidirectional.") | ||
| public ResponseEntity<VoteResponse> submitVote( | ||
| @RequestHeader("X-User-Id") String userId, | ||
| @Valid @RequestBody VoteRequest request) { | ||
| VoteResponse response = schedulingService.submitVote(userId, request); | ||
| return ResponseEntity.ok(response); | ||
| } | ||
| } | ||
29 changes: 29 additions & 0 deletions
29
server/src/main/java/de/tum/cit/memo/dto/RelationshipTaskResponse.java
This file contains hidden or 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,29 @@ | ||
| package de.tum.cit.memo.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class RelationshipTaskResponse { | ||
|
|
||
| private String relationshipId; | ||
| private CompetencyInfo origin; | ||
| private CompetencyInfo destination; | ||
| private String pipeline; | ||
| private VoteCounts currentVotes; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public static class CompetencyInfo { | ||
| private String id; | ||
| private String title; | ||
| private String description; | ||
| } | ||
| } |
This file contains hidden or 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,18 @@ | ||
| package de.tum.cit.memo.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class VoteCounts { | ||
|
|
||
| private int assumes; | ||
| private int extendsRelation; | ||
| private int matches; | ||
| private int unrelated; | ||
| } |
This file contains hidden or 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
17 changes: 17 additions & 0 deletions
17
server/src/main/java/de/tum/cit/memo/dto/VoteResponse.java
This file contains hidden or 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,17 @@ | ||
| package de.tum.cit.memo.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class VoteResponse { | ||
|
|
||
| private boolean success; | ||
| private VoteCounts updatedVotes; | ||
| private double newEntropy; | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
63 changes: 63 additions & 0 deletions
63
server/src/main/java/de/tum/cit/memo/entity/CompetencyRelationshipVote.java
This file contains hidden or 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,63 @@ | ||
| package de.tum.cit.memo.entity; | ||
|
|
||
| import de.tum.cit.memo.enums.RelationshipType; | ||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.EnumType; | ||
| import jakarta.persistence.Enumerated; | ||
| import jakarta.persistence.FetchType; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.JoinColumn; | ||
| import jakarta.persistence.ManyToOne; | ||
| import jakarta.persistence.Table; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
| import org.hibernate.annotations.CreationTimestamp; | ||
| import org.hibernate.annotations.OnDelete; | ||
| import org.hibernate.annotations.OnDeleteAction; | ||
|
|
||
| import java.time.Instant; | ||
|
|
||
| @Entity | ||
| @Table(name = "competency_relationships_votes") | ||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class CompetencyRelationshipVote { | ||
|
|
||
| @Id | ||
| @Column(length = 30) | ||
| private String id; | ||
|
|
||
| @NotBlank | ||
| @Column(name = "relationship_id", nullable = false, length = 30) | ||
| private String relationshipId; | ||
|
|
||
| @NotBlank | ||
| @Column(name = "user_id", nullable = false, length = 30) | ||
| private String userId; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @Column(name = "relationship_type", nullable = false) | ||
| @NotNull | ||
| private RelationshipType relationshipType; | ||
|
|
||
| // Relationships | ||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "relationship_id", insertable = false, updatable = false) | ||
| @OnDelete(action = OnDeleteAction.CASCADE) | ||
| private CompetencyRelationship relationship; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "user_id", insertable = false, updatable = false) | ||
| private User user; | ||
|
|
||
| @CreationTimestamp | ||
| @Column(nullable = false, updatable = false) | ||
| private Instant createdAt; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.