(@Valid CommentPostDTO commentReq, User user)
| 46 | private String frontendUrl; |
| 47 | |
| 48 | public Comment create(@Valid CommentPostDTO commentReq, User user) { |
| 49 | Comment comment = commentMapper.fromPostDto(commentReq); |
| 50 | WorkOrder workOrder = workOrderService.checkAccessToWorkOrderId(commentReq.getWorkOrder().getId(), user); |
| 51 | |
| 52 | comment.setUser(user); |
| 53 | Comment savedComment = commentRepository.saveAndFlush(comment); |
| 54 | em.refresh(savedComment); |
| 55 | |
| 56 | Set<User> notifiedUsers = getNotifiedUsers(savedComment, workOrder, user); |
| 57 | sendCommentNotifications(savedComment, workOrder, notifiedUsers, user, false); |
| 58 | |
| 59 | return savedComment; |
| 60 | } |
| 61 | |
| 62 | |
| 63 | public List<Comment> getAll() { |
nothing calls this directly
no test coverage detected