basic structure for notification system

This commit is contained in:
2026-01-06 17:54:11 +01:00
parent bda244a2e8
commit 17636f0b65
4 changed files with 59 additions and 0 deletions
@@ -0,0 +1,44 @@
package SuMoC.backend.notification.models;
import SuMoC.backend.notification.enums.NotificationStatus;
import SuMoC.backend.user.models.User;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import java.time.LocalTime;
@Entity
@Table(name = "notifications")
@Getter
@Setter
public class Notification {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JoinColumn(name = "user_id", nullable = false)
private User user;
@Column(nullable = false)
private String message;
/**
* Time of day from which on a notification might be sent.
* Useful since we might want to send messages about specific trips immediately but not inform about trend changes
* etc. in the middle of night when calculating jobs might run.
*/
@Column(nullable = false)
private LocalTime earliestTimeOfDayToSend;
@Column(nullable = false)
private NotificationStatus status;
@Column(nullable = false)
private int retryCount;
@Column(nullable = false)
private LocalDateTime createdAt;
}