feat: allow updating notification prefs

This commit is contained in:
Tim
2025-08-12 14:28:34 +08:00
parent d195d2f624
commit 02076e24e5
7 changed files with 151 additions and 10 deletions

View File

@@ -7,6 +7,8 @@ import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;
/**
* Simple user entity with basic fields and a role.
@@ -62,6 +64,12 @@ public class User {
@Enumerated(EnumType.STRING)
private MedalType displayMedal;
@ElementCollection(targetClass = NotificationType.class)
@CollectionTable(name = "user_disabled_notification_types", joinColumns = @JoinColumn(name = "user_id"))
@Column(name = "notification_type")
@Enumerated(EnumType.STRING)
private Set<NotificationType> disabledNotificationTypes = new HashSet<>();
@CreationTimestamp
@Column(nullable = false, updatable = false,
columnDefinition = "DATETIME(6) DEFAULT CURRENT_TIMESTAMP(6)")