package incheon.ags.mrb.share.web.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * 레시피 공유 신청 DTO
 * 레시피 공유 요청 정보를 담는 DTO
 */
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Schema(description = "레시피 공유 신청 정보")
public class RecipeShareDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 공유 ID */
    @Schema(description = "공유 ID", example = "1")
    private Integer shareId;

    /** 레시피 ID */
    @Schema(description = "레시피 ID", example = "1")
    private Integer recipeId;

    /** 레시피명 */
    @Schema(description = "레시피명", example = "인천 주요 관광지 현황")
    private String recipeNm;

    /** 썸네일 URL */
    @Schema(description = "썸네일 URL", example = "/static/thumbs/recipe-1.png")
    private String thmbUrl;

    /** 공유 대상 목록 (타입별: U-사용자, G-그룹) */
    @Schema(description = "공유 대상 목록",
            example = "[{\"type\": \"U\", \"id\": \"user123\"}, {\"type\": \"G\", \"id\": \"groupA\"}]")
    @JsonProperty("shareTargets")
    private List<ShareTargetDTO> shareTargets;

    /** 공유 대상 이름 목록 (조회용) */
    @Schema(description = "공유 대상 이름 목록 (조회용)", example = "[\"토지정보과-홍길동\", \"정책과-김길동\"]")
    @JsonProperty("shareTargetNames")
    private List<String> shareTargetNames;

    /** 사용 데이터 목록 */
    @Schema(description = "사용 데이터 목록", example = "연속지적도, 건물통합정보")
    private String usedData;

    /** 공유 신청일 */
    @Schema(description = "공유 신청일", example = "2025-01-21")
    private String shareDate;

    /** 공유 신청자 ID */
    @Schema(description = "공유 신청자 ID", example = "user01")
    private String requesterId;

    /** 공유 신청자 이름 */
    @Schema(description = "공유 신청자 이름", example = "홍길동")
    private String requesterName;

    /** 승인 상태 (P: 대기, A: 승인, R: 거부) */
    @Schema(description = "승인 상태", example = "P")
    private String approvalStatus;

    /** 승인자 ID */
    @Schema(description = "승인자 ID", example = "admin01")
    private String approverId;

    /** 승인일 */
    @Schema(description = "승인일")
    private LocalDate approvalDate;
}
