Files
sumoc-backend/src/main/java/SuMoC/backend/trip/dtos/NewTripDTO.java
T
neuhauss dfa5ee9559
LocationBasedServices/sumoc-backend/pipeline/pr-main Build queued...
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
add co2emissions to trip model and update tripfactory
2026-01-06 14:07:39 +01:00

38 lines
1.2 KiB
Java

package SuMoC.backend.trip.dtos;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.time.LocalDateTime;
import java.util.Set;
/**
* DTO representing a trip submitted from the App which is not yet persisted in the database.
* TODO assumption is that cost of trip is calculated server-side
*/
@Builder
@Schema(description = "DTO for creating a new Trip")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class NewTripDTO {
@Schema(description = "High level description of the trip's starting location")
private String startPlace;
private double startLatitude;
private double startLongitude;
@Schema(description = "High level description of the trip's ending location")
private String endPlace;
private double endLatitude;
private double endLongitude;
private LocalDateTime startTime;
private LocalDateTime endTime;
private double mobilityScore;
private double co2Emissions;
@NotNull
@Size(min = 1, message = "Trip must contain at least one segment.")
private Set<NewTripSegmentDTO> tripSegments;
}