Works
This commit is contained in:
@ -1,14 +1,16 @@
|
||||
package com.plannaplan.services;
|
||||
|
||||
import com.plannaplan.abstracts.EventWatcher;
|
||||
import java.util.List;
|
||||
|
||||
import com.plannaplan.entities.Assignment;
|
||||
import com.plannaplan.entities.Commision;
|
||||
import com.plannaplan.repositories.AssignmentRepository;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AssignmentService extends EventWatcher {
|
||||
public class AssignmentService {
|
||||
@Autowired
|
||||
private AssignmentRepository repo;
|
||||
|
||||
@ -19,4 +21,8 @@ public class AssignmentService extends EventWatcher {
|
||||
public void save(Assignment assignment) {
|
||||
this.repo.save(assignment);
|
||||
}
|
||||
|
||||
public List<Assignment> getCommisionAssignments(Commision com) {
|
||||
return this.repo.getByCommision(com.getId());
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.plannaplan.services;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.plannaplan.entities.Commision;
|
||||
import com.plannaplan.entities.User;
|
||||
@ -27,4 +28,8 @@ public class CommisionService {
|
||||
Long id = user.getId();
|
||||
return this.repo.getUsers(id);
|
||||
}
|
||||
|
||||
public Optional<Commision> getNewestCommision(User user) {
|
||||
return Optional.of(this.repo.getNewestCommision(user.getId()).get(0));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user