30 lines
971 B
Java
30 lines
971 B
Java
package SuMoC.backend.notification.config;
|
|
|
|
import SuMoC.backend.notification.enums.NotificationType;
|
|
import lombok.Data;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
@Data
|
|
@Component
|
|
@ConfigurationProperties(prefix = "sumoc.notification")
|
|
public class NotificationProperties {
|
|
/**
|
|
* Maximum number of failed send attempts before giving up on a notification.
|
|
*/
|
|
private int maxFailedSendAttempts = 3;
|
|
|
|
/**
|
|
* Maximum number of notifications to send to a user per hour per notification type.
|
|
*/
|
|
private Map<NotificationType, Integer> maxNotificationsPerHourPerType = new HashMap<>(Map.of(
|
|
NotificationType.TREND, 1,
|
|
NotificationType.ADHOC_ALTERNATIVE, 1,
|
|
NotificationType.REGULAR_TRIP_ALTERNATIVE, 1,
|
|
NotificationType.FRIENDSHIP_REQUEST_RECEIVED, 3
|
|
));
|
|
}
|