-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeEntryRequest.java
More file actions
101 lines (77 loc) · 2.39 KB
/
Copy pathTimeEntryRequest.java
File metadata and controls
101 lines (77 loc) · 2.39 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package ch.fhnw.timerecordingbackend.dto.time;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* Anfrageobjekt für das Erstellen oder Aktualisieren eines Zeiteintrags
* Enthält Datum, Start-/Endzeiten, optionale Pausen und Projekt-ID
* @author FA
* Code von anderen Teammitgliedern oder Quellen wird durch einzelne Kommentare deklariert
*/
public class TimeEntryRequest {
@NotNull
private LocalDate date;
private List<String> startTimes = new ArrayList<>();
private List<String> endTimes = new ArrayList<>();
private List<BreakTime> breaks = new ArrayList<>();
private Long projectId;
// Getter und Setter
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public List<String> getStartTimes() {
return startTimes;
}
public void setStartTimes(List<String> startTimes) {
this.startTimes = startTimes != null ? startTimes : new ArrayList<>();
}
public List<String> getEndTimes() {
return endTimes;
}
public void setEndTimes(List<String> endTimes) {
this.endTimes = endTimes != null ? endTimes : new ArrayList<>();
}
public List<BreakTime> getBreaks() {
return breaks;
}
public void setBreaks(List<BreakTime> breaks) {
this.breaks = breaks != null ? breaks : new ArrayList<>();
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
/**
* Innere statische Klasse zur Darstellung einer Pause innerhalb eines Zeiteintrags
* Jede Pause besteht aus einem Start- und einem Endzeitpunkt (Format: HH:mm)
*/
public static class BreakTime {
private String start;
private String end;
// Konstruktoren
public BreakTime() {}
public BreakTime(String start, String end) {
this.start = start;
this.end = end;
}
// Getter und Setter
public String getStart() {
return start;
}
public void setStart(String start) {
this.start = start;
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
}
}