38 lines
1.2 KiB
Java
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;
|
|
}
|