I wonder where to add method that reads my dto WindowDto.getPath().getPoints() and based on this collections returns some value (that value will be needed in some different srevices in my app):
public class WindowDto{
@JsonProperty("valid_from")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate validFrom;
@JsonProperty("valid_to")
@FutureOrPresent
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate validTo;
@JsonProperty("type")
private String type;
@JsonProperty("path")
@Valid
private PathDto path;
@Data
public static class PathDto {
@JsonProperty("points")
private Set<PointDto> points;
}
//maybe here my helper method
public Long getStoreId(){
//iterate over points and make some pure operations on this collection without using any repository etc...
}
Is it good practice to add such helper method in DTO? Or maybe create some other static class like WindowDtoHelper?