-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathReminder.java
More file actions
74 lines (59 loc) · 1.52 KB
/
Copy pathReminder.java
File metadata and controls
74 lines (59 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package com.libraryman_api.entity;
import java.time.LocalDate;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
/**
* Entity representing a scheduled reminder for borrowed books.
*
* <p>This entity is created at the time of borrowing a book and is used to
* efficiently schedule due-date and overdue notifications without scanning
* all borrow records daily.</p>
*
* <p>Each reminder is triggered on a specific date and marked as sent
* after notification delivery.</p>
*/
@Entity
public class Reminder {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getBorrowingId() {
return borrowingId;
}
public void setBorrowingId(Long borrowingId) {
this.borrowingId = borrowingId;
}
public LocalDate getReminderDate() {
return reminderDate;
}
public void setReminderDate(LocalDate reminderDate) {
this.reminderDate = reminderDate;
}
public boolean isSent() {
return sent;
}
public void setSent(boolean sent) {
this.sent = sent;
}
public ReminderType getType() {
return type;
}
public void setType(ReminderType type) {
this.type = type;
}
private Long borrowingId;
private LocalDate reminderDate;
private boolean sent;
@Enumerated(EnumType.STRING)
private ReminderType type;
}