add basic trip upload and retrieval functionality

This commit is contained in:
2025-12-12 12:56:47 +01:00
parent 32af17cd4d
commit d2b4d3b750
10 changed files with 70 additions and 30 deletions
@@ -42,12 +42,12 @@ public class Trip {
private float cost;
@OneToMany(mappedBy = "trip", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<TripSegment> segments = new HashSet<>();
private Set<TripSegment> tripSegments = new HashSet<>();
public Trip() {}
public Trip(Long id, User user, String startPlace, String endPlace, LocalDateTime startTime, LocalDateTime endTime, float mobilityScore, float cost, Set<TripSegment> segments) {
public Trip(Long id, User user, String startPlace, String endPlace, LocalDateTime startTime, LocalDateTime endTime, float mobilityScore, float cost, Set<TripSegment> tripSegments) {
this.id = id;
this.user = user;
this.startPlace = startPlace;
@@ -56,7 +56,7 @@ public class Trip {
this.endTime = endTime;
this.mobilityScore = mobilityScore;
this.cost = cost;
this.segments = segments;
this.tripSegments = tripSegments;
}
public Long getId() {
@@ -111,8 +111,8 @@ public class Trip {
return mobilityScore;
}
public void setMobilityScore(float score) {
this.mobilityScore = score;
public void setMobilityScore(float mobilityScore) {
this.mobilityScore = mobilityScore;
}
public float getCost() {
@@ -123,11 +123,11 @@ public class Trip {
this.cost = cost;
}
public Set<TripSegment> getSegments() {
return segments;
public Set<TripSegment> getTripSegments() {
return tripSegments;
}
public void setSegments(Set<TripSegment> segments) {
this.segments = segments;
public void setTripSegments(Set<TripSegment> segments) {
this.tripSegments = segments;
}
}