implement trend detection logic
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good

- for now aimed to detect weekly trends in car distances, easily extendable to all other attributes of the statsm model
- including test
This commit is contained in:
2026-01-07 15:28:35 +01:00
parent ec0615f6df
commit 6e458edd5c
13 changed files with 376 additions and 23 deletions
@@ -1,5 +1,6 @@
package SuMoC.backend.trenddetection.models;
import SuMoC.backend.trenddetection.enums.StatAttribute;
import SuMoC.backend.user.models.User;
import jakarta.persistence.*;
import lombok.*;
@@ -77,4 +78,10 @@ public class WeeklyMobilityStats {
@Column(nullable = false)
private Long sumMetersTaxi = 0L;
public Long getValueFor(StatAttribute attribute) {
return switch (attribute) {
case CAR_DISTANCE -> sumMetersCar;
};
}
}