summaryrefslogtreecommitdiff
path: root/src/main/java/com/stileeducation/markr/service/StudentService.java
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@skas.io>2024-07-25 20:36:11 +1000
committerSzymon Szukalski <szymon@skas.io>2024-07-25 20:36:11 +1000
commitaa9bdd514ab90d0da0391b879255a22c29450e9a (patch)
tree9ddd1de0ab7e376ead06f55bdb32a6190d3647d5 /src/main/java/com/stileeducation/markr/service/StudentService.java
parentec81d98e90f9fdb4dd12138a365fbbbb3a8efa5f (diff)
Validate import payload and return create/update stats
- Add validation to /import payload - Move import logic to service bean - Track whether entities have been created or update - Report number of created and updated entities as return value for the import endpoint - Add some test coverage to exercise the validators
Diffstat (limited to 'src/main/java/com/stileeducation/markr/service/StudentService.java')
-rw-r--r--src/main/java/com/stileeducation/markr/service/StudentService.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/java/com/stileeducation/markr/service/StudentService.java b/src/main/java/com/stileeducation/markr/service/StudentService.java
index 4af4d63..3ce28c0 100644
--- a/src/main/java/com/stileeducation/markr/service/StudentService.java
+++ b/src/main/java/com/stileeducation/markr/service/StudentService.java
@@ -22,6 +22,7 @@ public class StudentService {
student.setFirstName(firstName);
student.setLastName(lastName);
student.setStudentNumber(studentNumber);
+ student.setCreated(true);
return studentRepository.save(student);
}
}