package gc.mda.signal_batch.domain.gis.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import gc.mda.signal_batch.global.config.FlexibleLocalDateTimeDeserializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "타일 집계 조회 요청")
public class TileAggregationRequest {

    @Schema(
        description = """
            조회 시작 시간.
            지원 형식: ISO 8601 (2026-01-20T00:00:00, 2026-01-20T00:00:00Z),
            표준 형식 (2026-01-20 00:00:00), 압축 형식 (20260120000000)
            """,
        example = "2026-01-20T00:00:00"
    )
    @JsonDeserialize(using = FlexibleLocalDateTimeDeserializer.class)
    private LocalDateTime fromDate;

    @Schema(
        description = """
            조회 종료 시간.
            지원 형식: ISO 8601 (2026-01-20T23:59:59, 2026-01-20T23:59:59Z),
            표준 형식 (2026-01-20 23:59:59), 압축 형식 (20260120235959)
            """,
        example = "2026-01-20T23:59:59"
    )
    @JsonDeserialize(using = FlexibleLocalDateTimeDeserializer.class)
    private LocalDateTime toDate;

    @Schema(description = "타일 ID", example = "12_3456_7890")
    private String tileId;
}
