From e3bbbf2587631e3042d7dde11558112b3b0ba117 Mon Sep 17 00:00:00 2001 From: PauBarahona22 Date: Wed, 11 Dec 2024 22:14:10 +0100 Subject: [PATCH 1/2] User and status added to visit --- .../udl/eps/softarch/demo/domain/Visit.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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..a2fc67d 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,33 @@ 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; + + public enum Status { + PENDING("pending"), + ACCEPTED("accepted"), + REJECTED("rejected"); + + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + @ManyToOne @NotNull @@ -34,4 +61,5 @@ public class Visit extends UriEntity { public void setVisitDateTime(ZonedDateTime parse) { this.when = parse; } -} \ No newline at end of file +} + From 882d156dadb9756925a7c453f1e92ce889a569a3 Mon Sep 17 00:00:00 2001 From: PauBarahona22 Date: Wed, 11 Dec 2024 22:32:37 +0100 Subject: [PATCH 2/2] Visit status --- src/main/java/cat/udl/eps/softarch/demo/domain/Visit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a2fc67d..6d2ce27 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 @@ -34,7 +34,7 @@ public class Visit extends UriEntity { @Setter @Getter @NotNull - private Status status; + private Status status = Status.PENDING; public enum Status { PENDING("pending"),