Skip to content

Commit

Permalink
Merge pull request #117 from UdL-EPS-SoftArch/116-modification_in_vis…
Browse files Browse the repository at this point in the history
…it_model_for_the_backend

User and status added to visit
  • Loading branch information
rogargon authored Dec 12, 2024
2 parents 4183936 + 882d156 commit 59a7ac9
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/main/java/cat/udl/eps/softarch/demo/domain/Visit.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@ public class Visit extends UriEntity<Long> {
@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");

private final String value;

Status(String value) {
this.value = value;
}

public String getValue() {
return value;
}
}


@ManyToOne
@NotNull
Expand All @@ -34,4 +61,5 @@ public class Visit extends UriEntity<Long> {
public void setVisitDateTime(ZonedDateTime parse) {
this.when = parse;
}
}
}

0 comments on commit 59a7ac9

Please sign in to comment.