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 93f5e37ebd833d0fc5819ab73c7c0aaeb1d7a66f Mon Sep 17 00:00:00 2001 From: nero Date: Tue, 20 Feb 2024 18:36:15 +0100 Subject: [PATCH 2/4] add Shelter class --- .../udl/eps/softarch/demo/domain/Shelter.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java new file mode 100644 index 00000000..ecd02ee6 --- /dev/null +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java @@ -0,0 +1,56 @@ +package cat.udl.eps.softarch.demo.domain; + +import jakarta.persistence.*; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.PastOrPresent; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Entity +@Table(name = "Shelter") +@Data +@EqualsAndHashCode(callSuper = true) +public class Shelter extends UriEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @NotBlank + private String name; + + @NotBlank + @Email + @Column(unique = true) + private String email; + + @NotBlank + @Column(unique = true) + private String mobile; + + public String getEmail() { + return email; + } + + public Integer getId() { + return id; + } + + public String getMobile() { + return mobile; + } + + @PastOrPresent + @NotNull + private LocalDateTime createdAt; + + @PastOrPresent + private LocalDateTime updatedAt; + + @NotNull + private boolean isActive; + + private Integer rating; +} \ No newline at end of file From 16bd5cc4a6523388c3130dc943c929d6e64484b3 Mon Sep 17 00:00:00 2001 From: Sebastian Jitaru Date: Wed, 21 Feb 2024 17:49:46 +0100 Subject: [PATCH 3/4] Getters removed --- .../cat/udl/eps/softarch/demo/domain/Shelter.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java index ecd02ee6..531b1f46 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java @@ -3,11 +3,14 @@ import jakarta.persistence.*; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.PastOrPresent; import lombok.Data; import lombok.EqualsAndHashCode; +import java.time.LocalDateTime; + @Entity @Table(name = "Shelter") @Data @@ -30,18 +33,6 @@ public class Shelter extends UriEntity { @Column(unique = true) private String mobile; - public String getEmail() { - return email; - } - - public Integer getId() { - return id; - } - - public String getMobile() { - return mobile; - } - @PastOrPresent @NotNull private LocalDateTime createdAt; From 91563c4ddf0f6708ed08555f155af10b2dfe0507 Mon Sep 17 00:00:00 2001 From: vGerJ02 Date: Wed, 21 Feb 2024 19:01:06 +0100 Subject: [PATCH 4/4] fix: change id to Long --- .../java/cat/udl/eps/softarch/demo/domain/Shelter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java index 531b1f46..9fd2b1fa 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java @@ -9,7 +9,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; -import java.time.LocalDateTime; +import java.time.ZonedDateTime; @Entity @Table(name = "Shelter") @@ -19,7 +19,7 @@ public class Shelter extends UriEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; + private Long id; @NotBlank private String name; @@ -35,10 +35,10 @@ public class Shelter extends UriEntity { @PastOrPresent @NotNull - private LocalDateTime createdAt; + private ZonedDateTime createdAt; @PastOrPresent - private LocalDateTime updatedAt; + private ZonedDateTime updatedAt; @NotNull private boolean isActive;