From 8e4d094fe368dcbea247ade0701bc5b2598df6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pol=20Escol=C3=A0=20Curc=C3=B3?= Date: Thu, 15 Feb 2024 16:46:55 +0100 Subject: [PATCH 1/4] umlUpdated --- EntitiesModel.puml | 99 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 4 deletions(-) diff --git a/EntitiesModel.puml b/EntitiesModel.puml index e243271f..4ea591b9 100644 --- a/EntitiesModel.puml +++ b/EntitiesModel.puml @@ -1,15 +1,106 @@ @startuml - -class User extends UriEntity implements UserDetails { +interface User extends UriEntity implements UserDetails { username : String password : String email : String + dni: String + dateOfBirth: String +} +class Client implements User{ + +} +class Admin implements User{ + +} +class ShelterVolunteer implements User{ + } class UriEntity { uri : String } -User "1" --right-- "*" Resource : owner < +class Pet { + id: Integer + name: String + isAdopted: Boolean + color: String + size: String + weight: double + age: String + description: String + breed: String + +} + +class Shelter { + id: Integer + name: String + email: String + mobile : String + createdAt: DateDateTime + updatedAt: DateDateTime + isActive: Boolean + rating: Integer + +} + +class Location { + id: Integer + address: String + latitude: Float + longitude: Float + province: String + municipality: String + postalCode: String +} + +class ShelterCertificate { + id: String + expirationDate: DateDateTime +} + +class SocialNetworks { + id: Integer + instagram: String + twitter: String +} + +class Schedule { + id: Integer + startDateTime: DateTime + endDateTime: DateTime +} + +class Adoption{ + id: Integer + type: String + confirmed: Boolean + startDate: DateTime + endDate: DateTime +} + + + +class MedicalRecord { + id : Integer + issue : String + description: String + date : Date +} + + +Pet "1" -- "*" MedicalRecord : has > + + +Location "1" -> "1" Shelter : has> -@enduml +Shelter "1" -> "*" SocialNetworks : < has +Shelter "1" -> "*" Pet : has > +Shelter "1" -> "1" ShelterCertificate : has > +Schedule "1.*" -> "1" Shelter :available > +Client "*" -> "*" Shelter : donate > +Adoption "*" -> "1" Pet :adopted > +Adoption "*" -> "1" User :adopt < +ShelterVolunteer "1.*" -> "*" Shelter : works > +@enduml \ No newline at end of file From 803e3ed8b99b031f058054e13cee02d587c3417c Mon Sep 17 00:00:00 2001 From: Codinab Date: Tue, 20 Feb 2024 16:02:49 +0100 Subject: [PATCH 2/4] MedicalRecord.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Mario Fernandez -Àlex Codina --- .../softarch/demo/domain/MedicalRecord.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java b/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java new file mode 100644 index 00000000..b045124e --- /dev/null +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java @@ -0,0 +1,51 @@ +package cat.udl.eps.softarch.demo.domain; + +import java.util.Date; + +public class MedicalRecord { + private Integer id; + private String issue; + private String description; + private Date date; + + // Constructor + public MedicalRecord(Integer id, String issue, String description, Date date) { + this.id = id; + this.issue = issue; + this.description = description; + this.date = date; + } + + // Getters and Setters + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getIssue() { + return issue; + } + + public void setIssue(String issue) { + this.issue = issue; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } +} \ No newline at end of file From 0d7f39b00e0d87f3f66893681bc889f3783adc4a Mon Sep 17 00:00:00 2001 From: Codinab Date: Wed, 21 Feb 2024 17:31:20 +0100 Subject: [PATCH 3/4] Fixed to extend UriEntity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Mario Fernandez -Àlex Codina --- .../eps/softarch/demo/domain/MedicalRecord.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java b/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java index b045124e..b56caadf 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java @@ -2,14 +2,16 @@ import java.util.Date; -public class MedicalRecord { - private Integer id; +public class MedicalRecord extends UriEntity { + private final Long id; private String issue; private String description; private Date date; + + // Constructor - public MedicalRecord(Integer id, String issue, String description, Date date) { + public MedicalRecord(Long id, String issue, String description, Date date) { this.id = id; this.issue = issue; this.description = description; @@ -17,14 +19,10 @@ public MedicalRecord(Integer id, String issue, String description, Date date) { } // Getters and Setters - public Integer getId() { + public Long getId() { return id; } - public void setId(Integer id) { - this.id = id; - } - public String getIssue() { return issue; } From 854ff55257f508d884c004f02389a11f27ad12de Mon Sep 17 00:00:00 2001 From: Codinab Date: Thu, 22 Feb 2024 15:43:09 +0100 Subject: [PATCH 4/4] Added annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Mario Fernandez -Àlex Codina --- .../softarch/demo/domain/MedicalRecord.java | 64 +++++++------------ 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java b/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java index b56caadf..69a4cc3d 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/MedicalRecord.java @@ -1,49 +1,31 @@ package cat.udl.eps.softarch.demo.domain; -import java.util.Date; - +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.ZonedDateTime; + +@EqualsAndHashCode(callSuper = true) +@Data +@Entity public class MedicalRecord extends UriEntity { - private final Long id; - private String issue; - private String description; - private Date date; - - - - // Constructor - public MedicalRecord(Long id, String issue, String description, Date date) { - this.id = id; - this.issue = issue; - this.description = description; - this.date = date; - } - - // Getters and Setters - public Long getId() { - return id; - } - public String getIssue() { - return issue; - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - public void setIssue(String issue) { - this.issue = issue; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } + @NotBlank + private String issue; - public Date getDate() { - return date; - } + @NotBlank + private String description; - public void setDate(Date date) { - this.date = date; - } + @NotNull + private ZonedDateTime date; } \ No newline at end of file