package com.caliverse.admin.domain.request;

import java.time.LocalDateTime;
import java.util.List;

import com.caliverse.admin.domain.entity.Item;
import com.caliverse.admin.domain.entity.Mail;
import com.caliverse.admin.domain.entity.Message;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class MailRequest {

    private Long id;
    private String guid;
    @JsonProperty("file_name")
    private String fileName;
    @JsonProperty("mail_list")
    private List<Message> mailList;
    @JsonProperty("item_list")
    private List<Item> itemList;            // 아이템
    @JsonProperty("resource_list")
    private List<Item> resourceList;            // 자원
    @JsonProperty("is_reserve")
    private boolean isReserve;      // 예약 발송 여부
    @JsonProperty("send_type")
    private Mail.SENDTYPE sendType;

    @JsonProperty("send_dt")
    private LocalDateTime sendDt;   // 발송 시간
    @JsonProperty("mail_type")
    private Mail.MAILTYPE mailType;        // 우편 타입
    @JsonProperty("user_type")
    private Mail.USERTYPE userType;        // 수신 타입
    @JsonProperty("receive_type")       // 수신 대상 (단일/복수)
    private Mail.RECEIVETYPE receiveType;
    private String target;                // 단일 guid 혹은 엑셀 업로드한 경로

    @JsonProperty("create_by")
    private Long createBy;
    @JsonProperty("create_dt")
    private LocalDateTime createDt;
    @JsonProperty("update_by")
    private Long updateBy;
    @JsonProperty("update_dt")
    private LocalDateTime updateDt;

    //삭제용 id
    private List<Mail> list;


    @Getter
    public static class DeleteMail {
        // 삭제용 id
        private String id;
        private String guid;
    }

    @Getter
    public static class DeleteMailItem {
        private String type;
        private String guid;
        @JsonProperty("mail_guid")
        private String MailGuid;
        @JsonProperty("item_id")
        private Long itemId;
        @JsonProperty("parrent_count")
        private Double parrentCount;
        private Double count;
    }
}
