diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Visit.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Visit.java index 5070dc0..e675ebd 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Visit.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Visit.java @@ -25,6 +25,34 @@ public class Visit extends UriEntity { @Column(name = "visit_date") private ZonedDateTime when; + @ManyToOne + @JoinColumn(name = "username_id") + private User username; + + // Setter + // Getter + @Setter + @Getter + @NotNull + private Status status = Status.PENDING; + + public enum Status { + PENDING("pending"), + ACCEPTED("accepted"), + REJECTED("rejected"), + CANCELLED("cancelled"); + + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + @ManyToOne @NotNull @@ -34,4 +62,5 @@ public class Visit extends UriEntity { public void setVisitDateTime(ZonedDateTime parse) { this.when = parse; } -} \ No newline at end of file +} +