From 8094573b57cfde141b9f67f90986277165db7202 Mon Sep 17 00:00:00 2001 From: Ramon Trekovanicz Date: Sat, 31 Aug 2024 12:03:57 +0200 Subject: [PATCH] feat: add ClinicDetails --- .../backend/models/ClinicDetails.java | 27 +++++++++++++++++++ .../greenfoxacademy/backend/models/Vet.java | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 backend/src/main/java/com/greenfoxacademy/backend/models/ClinicDetails.java diff --git a/backend/src/main/java/com/greenfoxacademy/backend/models/ClinicDetails.java b/backend/src/main/java/com/greenfoxacademy/backend/models/ClinicDetails.java new file mode 100644 index 00000000..fbc1b5fe --- /dev/null +++ b/backend/src/main/java/com/greenfoxacademy/backend/models/ClinicDetails.java @@ -0,0 +1,27 @@ +package com.greenfoxacademy.backend.models; + +import jakarta.persistence.Embeddable; +import lombok.Data; + +/** + * Represents the details of a clinic. + *

+ * The {@code ClinicDetails} class is used as an embeddable type in JPA entities to store detailed + * information about a clinic. This class contains the address of the clinic as well as any + * additional details that may be relevant for clinic management. + *

+ *

+ * This class is annotated with {@code @Embeddable} to indicate that it can be embedded within + * other JPA entities. + *

+ * + * @see ClinicAddress + */ + +@Data +@Embeddable +public class ClinicDetails { + + private ClinicAddress clinicAddress; + +} diff --git a/backend/src/main/java/com/greenfoxacademy/backend/models/Vet.java b/backend/src/main/java/com/greenfoxacademy/backend/models/Vet.java index 86f0b696..d99bd34c 100644 --- a/backend/src/main/java/com/greenfoxacademy/backend/models/Vet.java +++ b/backend/src/main/java/com/greenfoxacademy/backend/models/Vet.java @@ -37,7 +37,7 @@ @Entity @Table(name = "_vet") public class Vet extends User { - private ClinicAddress clinicAddress; + private ClinicDetails clinicDetails; @Override @Transient