Files
hemhub/src/main/java/se/urmo/hemhub/notify/LogNotificationService.java
Urban Modig 54b70d9494
All checks were successful
continuous-integration/drone/push Build is passing
Minor change to trigger pipeline
2025-10-08 17:31:57 +02:00

32 lines
1.1 KiB
Java

package se.urmo.hemhub.notify;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import se.urmo.hemhub.domain.Task;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service
public class LogNotificationService implements NotificationService {
@Override
public void notifyTasksDueTomorrow(List<Task> tasks) {
if (tasks.isEmpty()) {
log.info("[reminder] No tasks due tomorrow.");
return;
}
var summary = tasks.stream()
.map(t -> String.format("%s (prio=%s, status=%s, household=%s, project=%s, assignee=%s)",
t.getTitle(),
t.getPriority(),
t.getStatus(),
t.getHousehold().getId(),
t.getProject() != null ? t.getProject().getId() : "",
t.getAssigneeSub() != null ? t.getAssigneeSub() : ""))
.collect(Collectors.joining("; "));
log.info("[reminder] Tasks due tomorrow: {} !", summary);
}
}