package incheon.ags.ias.tmap.web.dto;

import incheon.ags.ias.tmap.vo.TmapVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;

/**
 * 주제도 API 요청을 위한 DTO 클래스
 */
@Getter
@Setter
public class TmapRequestDTO {

    @Schema(description = "주제도일련번호", example = "1")
    private Long tmapSn;

    @Schema(description = "주제도명", example = "인천시 토지이용계획도", required = true)
    @NotBlank(message = "주제도명은 필수 항목입니다.")
    private String tmapNm;

    @Schema(description = "주제도URL주소", example = "https://gis.incheon.go.kr/tmap/land")
    private String tmapUrlAddr;

    @Schema(description = "주제도설명", example = "인천시 전체 토지이용 현황을 나타내는 주제도입니다.")
    private String tmapExpln;

    @Schema(description = "시작일자 (YYYYMMDD)", example = "20250101")
    private String bgngYmd;

    @Schema(description = "종료일자 (YYYYMMDD)", example = "20251231")
    private String endYmd;

    public TmapVO toEntity() {
        TmapVO tmapVO = new TmapVO();
        tmapVO.setTmapSn(tmapSn);
        tmapVO.setTmapNm(tmapNm);
        tmapVO.setTmapUrlAddr(tmapUrlAddr);
        tmapVO.setTmapExpln(tmapExpln);
        tmapVO.setBgngYmd(bgngYmd);
        tmapVO.setEndYmd(endYmd);
        return tmapVO;
    }
}
