This commit is contained in:
2025-10-02 18:01:23 +02:00
parent 210611bbbe
commit e7784f31bb
44 changed files with 1787 additions and 93 deletions

View File

@@ -2,6 +2,7 @@ package de.iwomm.propify_api.entity;
import com.fasterxml.jackson.annotation.JsonBackReference;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.ArrayList;
@@ -17,6 +18,8 @@ public class Property {
@Column(nullable = false)
private String name;
private String owner;
@Column(nullable = false)
private String street;
@@ -29,10 +32,18 @@ public class Property {
@Column(nullable = false)
private String city;
@ManyToOne
@JoinColumn(name = "federal_state_id")
private FederalState federalState;
private String notes;
@Column(nullable = false)
private String country;
private int yearOfConstruction; // baujahr
@Column(nullable = false)
private int unitCount; // anzahl einheiten
@OneToMany(mappedBy = "property", orphanRemoval = true)
@OrderBy("fileName")
@@ -48,6 +59,18 @@ public class Property {
@JsonBackReference
private List<Project> projects = new ArrayList<>();
@ManyToOne(optional = false)
@JoinColumn(name = "property_status_id", nullable = false)
private PropertyStatus propertyStatus;
public PropertyStatus getPropertyStatus() {
return propertyStatus;
}
public void setPropertyStatus(PropertyStatus propertyStatus) {
this.propertyStatus = propertyStatus;
}
public List<Project> getProjects() {
return projects;
}
@@ -67,14 +90,19 @@ public class Property {
public Property() {}
public Property(String name, String street, String houseNumber, String zipCode, String city, String country, String notes) {
public Property(
String name, String street, String houseNumber,
String zipCode, String city,
FederalState federalState,
String notes, PropertyStatus propertyStatus) {
this.name = name;
this.street = street;
this.houseNumber = houseNumber;
this.zipCode = zipCode;
this.city = city;
this.country = country;
this.federalState = federalState;
this.notes = notes;
this.propertyStatus = propertyStatus;
}
@PrePersist
@@ -152,14 +180,6 @@ public class Property {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getNotes() {
return this.notes;
}
@@ -167,4 +187,36 @@ public class Property {
public void setNotes(String notes) {
this.notes = notes;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public int getYearOfConstruction() {
return yearOfConstruction;
}
public void setYearOfConstruction(int yearOfConstruction) {
this.yearOfConstruction = yearOfConstruction;
}
public int getUnitCount() {
return unitCount;
}
public void setUnitCount(int unitCount) {
this.unitCount = unitCount;
}
public FederalState getFederalState() {
return federalState;
}
public void setFederalState(FederalState federalState) {
this.federalState = federalState;
}
}