package incheon.ags.mrb.style.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

/**
 * @Class Name : RecipeLayerStyleVO.java
 * @Description : 레시피 레이어 스타일 VO 클래스
 * @Modification Information
 *
 *               수정일 수정자 수정내용
 *               ------- ------- -------------------
 *
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "레시피 레이어 스타일 정보")
public class RecipeLayerStyleVO {

    @Schema(description = "스타일 ID", example = "1")
    private Long styleId;

    @NotBlank(message = "작성자 ID는 필수입니다")
    @Size(max = 50, message = "작성자 ID는 50자를 초과할 수 없습니다")
    @Schema(description = "작성자 ID", example = "admin01", required = true)
    private String wrtrId;

    @NotBlank(message = "스타일명은 필수입니다")
    @Size(max = 100, message = "스타일명은 100자를 초과할 수 없습니다")
    @Schema(description = "스타일명", example = "point_style_01", required = true)
    private String styleNm;

    @NotBlank(message = "스타일 서비스명은 필수입니다")
    @Size(max = 64, message = "스타일 서비스명은 64자를 초과할 수 없습니다")
    @Schema(description = "스타일 서비스명", example = "geoserver_style_point", required = true)
    private String styleSrvcNm;

    @NotBlank(message = "스타일 타입 코드는 필수입니다")
    @Pattern(regexp = "^[SGCR]$", message = "스타일 타입 코드는 S, G, C, R 중 하나여야 합니다")
    @Schema(description = "스타일 타입 코드 (S: Single, G: Graduated, C: Categorized, R: Rule/Random)", example = "S", required = true)
    private String styleTypeCd;

    @NotBlank(message = "공간 타입은 필수입니다")
    @Size(max = 20, message = "공간 타입은 20자를 초과할 수 없습니다")
    @Schema(description = "공간 타입", example = "POINT", required = true)
    private String spceTy;

    @Schema(description = "최초등록일시", example = "2024-12-19T10:25:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime frstRegDt;

    @NotBlank(message = "최초등록자 ID는 필수입니다")
    @Size(max = 50, message = "최초등록자 ID는 50자를 초과할 수 없습니다")
    @Schema(description = "최초등록자 ID", example = "admin01", required = true)
    private String frstRegId;

    @Schema(description = "최종수정일시", example = "2024-12-19T10:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastMdfcnDt;

    @Size(max = 50, message = "최종수정자 ID는 50자를 초과할 수 없습니다")
    @Schema(description = "최종수정자 ID", example = "admin01")
    private String lastMdfcnId;

    @Schema(description = "아이콘 정보 (JSONB)", example = "{\"0\": \"36\"}")
    private String iconInfo;
}
