Some improvements:

* Switches to PostgreSQL
* Added Minio storage
* Added attachments to properties
* Introduced DTOs for improved security
This commit is contained in:
2025-09-03 15:40:26 +02:00
parent 9735f1f398
commit 5eb6b6e738
26 changed files with 879 additions and 67 deletions

View File

@@ -1,9 +1,9 @@
package de.iwomm.propify_api.entity;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.*;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;
@Entity
@@ -12,16 +12,83 @@ public class Property {
@GeneratedValue
private UUID id;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String street;
@Column(nullable = false)
private String houseNumber;
@Column(nullable = false)
private String zipCode;
@Column(nullable = false)
private String city;
private String country;
private String notes;
@Column(nullable = false)
private String country;
@OneToMany(mappedBy = "property", orphanRemoval = true)
@OrderBy("fileName")
private List<Attachment> attachments;
@Column(nullable = false)
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
public List<Attachment> getAttachments() {
return attachments;
}
public void setAttachments(List<Attachment> attachment) {
this.attachments = attachment;
}
public Property() {}
public Property(String name, String street, String houseNumber, String zipCode, String city, String country, String notes) {
this.name = name;
this.street = street;
this.houseNumber = houseNumber;
this.zipCode = zipCode;
this.city = city;
this.country = country;
this.notes = notes;
}
@PrePersist
protected void onCreate() {
this.createdAt = LocalDateTime.now();
this.updatedAt = LocalDateTime.now();
}
@PreUpdate
protected void onUpdate() {
this.updatedAt = LocalDateTime.now();
}
public LocalDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(LocalDateTime createdAt) {
this.createdAt = createdAt;
}
public LocalDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(LocalDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public void setId(UUID id) {
this.id = id;
}