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 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..bd3537d3 --- /dev/null +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java @@ -0,0 +1,24 @@ +package cat.udl.eps.softarch.demo.domain; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +@Entity +@Data +@EqualsAndHashCode(callSuper = true) +public class Schedule extends UriEntity { + + @Id + private Long id; + + @NotNull + private Date start; + + @NotNull + private Date finish; +}