package kr.xit.biz.ens.model.kakao.talk;

import java.util.List;

import javax.validation.Valid;
import javax.validation.constraints.Size;

import io.swagger.v3.oas.annotations.media.Schema;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.core.model.IApiResponse;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * <pre>
 * description : 카카오톡 전자문서 요청 파라메터 및 응답 DTO
 *
 * packageName : kr.xit.ens.model.kakao.talk
 * fileName    : KkotalkDTO
 * author      : limju
 * date        : 2024-08-12
 * ======================================================================
 * 변경일         변경자        변경 내용
 * ----------------------------------------------------------------------
 * 2024-08-12    limju       최초 생성
 *
 * </pre>
 */
public class KkotalkDTO extends KkotalkApiDTO {

    //------------------ envelop ----------------------------------------------------------------------
    @Schema(name = "SendRequest DTO", description = "문서발송 request DTO")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @SuperBuilder
    @EqualsAndHashCode(callSuper = false)
    public static class SendRequest extends CmmEnsRequestDTO {
        /**
         * <pre>
         * 상품 코드 - 필수
         * D10_1|D10_2|D11_1|D11_2
         * </pre>
         */
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "상품코드", example = "D10_2", allowableValues = {"D10_1","D10_2","D11_1","D11_2"})
        @Size(min = 3, max = 5, message = "상품 코드는 필수 입니다(\"D10_1\",\"D10_2\",\"D11_1\",\"D11_2\"")
        private String productCode = "D10_2";

        @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
        @Valid
        private Envelope envelope;
    }
    //------------------ envelop ----------------------------------------------------------------------

    //------------------ bulk  ----------------------------------------------------------------------
    @Schema(name = "BulkSendRequest DTO", description = "문서발송[bulk] request DTO")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @SuperBuilder
    @EqualsAndHashCode(callSuper = false)
    public static class BulkSendRequest extends CmmEnsRequestDTO {
        /**
         * <pre>
         * 상품 코드 - 필수
         * D10_1|D10_2|D11_1|D11_2
         * </pre>
         */
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "상품코드", example = "D10_1", allowableValues = {"D10_1","D10_2","D11_1","D11_2"})
        @Size(min = 3, max = 5, message = "상품 코드는 필수 입니다(\"D10_1\",\"D10_2\",\"D11_1\",\"D11_2\"")
        private String productCode = "D10_2";

        @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
        @Valid
        private List<Envelope> envelopes;
    }

    @Schema(name = "BulkSendResponse DTO", description = "문서발송(bulk) response DTO")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @SuperBuilder
    @EqualsAndHashCode(callSuper = false)
    public static class BulkSendResponse {
        private List<EnvelopeRes> envelopes;
    }

    @Schema(name = "BulkStatusRequest DTO", description = "문서상태조회[bulk] request DTO")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @SuperBuilder
    @EqualsAndHashCode(callSuper = false)
    public static class BulkStatusRequest extends CmmEnsRequestDTO {
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
        @Valid
        private List<String> envelopes;
    }

    @Schema(name = "BulkStatusResponse DTO", description = "문서상태조회(bulk) response DTO")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @SuperBuilder
    public static class BulkStatusResponse implements IApiResponse {
        private List<KkotalkApiDTO.EnvelopeStatusResponse> envelopeStatus;
    }
    //------------------ bulk ----------------------------------------------------------------------

}
