Creation of appointment implemented
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package de.etecture.ga.model;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
@@ -32,4 +35,14 @@ public class Appointment {
|
||||
private Integer slot = 1;
|
||||
|
||||
private Duration duration = Duration.ZERO;
|
||||
|
||||
|
||||
public LocalDateTime appointmentStart() {
|
||||
return Instant.ofEpochMilli(this.appointmentTime().getTime())
|
||||
.atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||
}
|
||||
|
||||
public LocalDateTime appointmentEnd() {
|
||||
return this.appointmentStart().plus(this.duration());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user