implemented scheduled tasks and notification scheduler so that whole chain task -> detected trends -> scheduled notification -> notification sent by worker is working

This commit is contained in:
2026-01-13 18:07:15 +01:00
parent 521a4ba957
commit 11ce10a8d8
14 changed files with 134 additions and 79 deletions
@@ -1,7 +1,7 @@
package SuMoC.backend.trend.dto;
import SuMoC.backend.notification.interfaces.Notifieable;
import SuMoC.backend.trend.enums.*;
import SuMoC.backend.user.models.User;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -9,8 +9,8 @@ import lombok.Data;
@Data
@Builder
@AllArgsConstructor
public class TrendDetectionDTO {
private User user;
public class TrendDetectionDTO implements Notifieable {
private Long userId;
private TrendTimespan timespan;
private TrendType type;
private StatAttribute attribute;
@@ -19,7 +19,7 @@ public class TrendDetectionDTO {
public static TrendDetectionDTO mockTrendDetectionDTO() {
return TrendDetectionDTO.builder()
.user(null) // Replace with a mock User if needed
.userId(null) // Replace with a mock User if needed
.timespan(TrendTimespan.WEEKLY)
.type(TrendType.INCREASING)
.attribute(StatAttribute.CAR_DISTANCE)