Creation of appointment implemented

This commit is contained in:
Matthias Engelien
2024-09-15 12:22:31 +02:00
parent a2164a0eb3
commit c311564ecc
7 changed files with 157 additions and 18 deletions

View File

@@ -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());
}
}