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/7] 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 dbb0c9d3b394a8898df14873b0bfd6e89013121d Mon Sep 17 00:00:00 2001 From: nero Date: Tue, 20 Feb 2024 18:49:05 +0100 Subject: [PATCH 2/7] add Schedule class Committer: Sebastian Jitaru --- .../eps/softarch/demo/domain/Schedule.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java new file mode 100644 index 00000000..a9139d4b --- /dev/null +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java @@ -0,0 +1,33 @@ +package cat.udl.eps.softarch.demo.domain; + +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.PastOrPresent; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Entity +@Table(name = "Schedule") //Avoid collision with system table User +@Data +@EqualsAndHashCode(callSuper = true) + +public class Schedule extends UriEntity { + + @Id + private Integer id; + + @NotNull + private LocalDateTime start; + + @NotNull + private LocalDateTime end; + + public LocalDateTime getStart() { + return start; + } + + public LocalDateTime getEnd() { + return end; + } +} \ No newline at end of file From c53711c5757ea4708bddf5f074879aab6899aadb Mon Sep 17 00:00:00 2001 From: Sebastian Jitaru Date: Wed, 21 Feb 2024 17:30:46 +0100 Subject: [PATCH 3/7] Added getter --- src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java index a9139d4b..00576885 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java @@ -30,4 +30,8 @@ public LocalDateTime getStart() { public LocalDateTime getEnd() { return end; } + + public Integer getId() { + return id; + } } \ No newline at end of file From 905888e0752b3fb0d082db1bd01fe2b8725fd520 Mon Sep 17 00:00:00 2001 From: vGerJ02 Date: Wed, 21 Feb 2024 17:49:17 +0100 Subject: [PATCH 4/7] fix: remove getters and correct imports --- .../cat/udl/eps/softarch/demo/domain/Schedule.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java index 00576885..b599a88e 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java @@ -2,11 +2,12 @@ import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.PastOrPresent; import lombok.Data; import lombok.EqualsAndHashCode; +import java.time.LocalDateTime; + @Entity @Table(name = "Schedule") //Avoid collision with system table User @Data @@ -23,15 +24,4 @@ public class Schedule extends UriEntity { @NotNull private LocalDateTime end; - public LocalDateTime getStart() { - return start; - } - - public LocalDateTime getEnd() { - return end; - } - - public Integer getId() { - return id; - } } \ No newline at end of file From d018f1f376d483a7eee031c323cdfb98a08b1b6a Mon Sep 17 00:00:00 2001 From: Sebastian Jitaru Date: Wed, 21 Feb 2024 18:57:18 +0100 Subject: [PATCH 5/7] getID added --- .../eps/softarch/demo/domain/Schedule.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java index b599a88e..4dc53941 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java @@ -1,12 +1,14 @@ package cat.udl.eps.softarch.demo.domain; -import jakarta.persistence.*; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; import jakarta.validation.constraints.NotNull; - import lombok.Data; import lombok.EqualsAndHashCode; -import java.time.LocalDateTime; +import java.util.Date; + @Entity @Table(name = "Schedule") //Avoid collision with system table User @@ -16,12 +18,17 @@ public class Schedule extends UriEntity { @Id - private Integer id; + private long id; @NotNull - private LocalDateTime start; + private Date start; @NotNull - private LocalDateTime end; + private Date end; + + @Override + public Long getId() { + return id; + } } \ No newline at end of file From 8154927c6bb92aa0da4525cde0e541756b10c1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Garc=C3=ADa?= Date: Thu, 22 Feb 2024 14:52:07 +0100 Subject: [PATCH 6/7] Fix annotations and remove unnecessary getter --- .../cat/udl/eps/softarch/demo/domain/Schedule.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java index 4dc53941..4c7d7442 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java @@ -2,33 +2,23 @@ import jakarta.persistence.Entity; import jakarta.persistence.Id; -import jakarta.persistence.Table; import jakarta.validation.constraints.NotNull; import lombok.Data; import lombok.EqualsAndHashCode; import java.util.Date; - @Entity -@Table(name = "Schedule") //Avoid collision with system table User @Data @EqualsAndHashCode(callSuper = true) - public class Schedule extends UriEntity { @Id - private long id; + private Long id; @NotNull private Date start; @NotNull private Date end; - - - @Override - public Long getId() { - return id; - } -} \ No newline at end of file +} From d16cd5a7d1d093e91e62a9a3457f580ff599e271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Garc=C3=ADa?= Date: Thu, 22 Feb 2024 14:52:49 +0100 Subject: [PATCH 7/7] Use `finish` instead of apparently protected `end` --- src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java index 4c7d7442..bd3537d3 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java @@ -20,5 +20,5 @@ public class Schedule extends UriEntity { private Date start; @NotNull - private Date end; + private Date finish; }