Skip to content

Commit

Permalink
add StudentMappingEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlxs committed Dec 6, 2024
1 parent 1788858 commit c6f953b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package de.unistuttgart.iste.meitrex.assignment_service.persistence.entity;

import de.unistuttgart.iste.meitrex.common.persistence.IWithId;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.UUID;

@Entity(name = "StudentMapping")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StudentMappingEntity implements IWithId<StudentMappingEntity.StudentMappingKey>{

// extra short constructor
public StudentMappingEntity(final UUID meitrexStudentId, final String externalStudentId) {
studentMappingKey = new StudentMappingKey(meitrexStudentId, externalStudentId);
}

@EmbeddedId
private StudentMappingKey studentMappingKey;

@Data
@Embeddable
@NoArgsConstructor
@AllArgsConstructor
public static class StudentMappingKey implements Serializable {
private UUID meitrexStudentId;
private String externalStudentId;
}

@Override
public StudentMappingKey getId() {
return studentMappingKey;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package de.unistuttgart.iste.meitrex.assignment_service.persistence.repository;

import de.unistuttgart.iste.meitrex.assignment_service.persistence.entity.StudentMappingEntity;
import de.unistuttgart.iste.meitrex.common.persistence.MeitrexRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface StudentMappingRepository extends MeitrexRepository<StudentMappingEntity, StudentMappingEntity.StudentMappingKey> {

}
12 changes: 12 additions & 0 deletions src/main/resources/graphql/service/grading.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,16 @@ type SubexerciseGrading {
The absolute number of achieved credits on the subexercise.
"""
achievedCredits: Float!
}

type StudentMapping {
"""
Student Id in Meitrex
"""
meitrexStudentId: UUID!

"""
Student Id in external system like TMS
"""
externalStudentId: String!
}

0 comments on commit c6f953b

Please sign in to comment.