package com.caliverse.admin.domain.entity;

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

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

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

@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Mail {
    private Long id;
    @JsonProperty("row_num")
    private Long rowNum;
    //우편 제목
    @JsonProperty("title")
    private String title;
    // 우편 내용
    private String content;
    // 아이템
    @JsonProperty("item_list")
    private List<Item> itemList;

    @JsonProperty("mail_list")
    private List<Message> mailList;

    @JsonProperty("guid_list")
    private List<Guid> guidList;
    // 예약 발송 여부
    @JsonProperty("is_reserve")
    private boolean isReserve;
    // 발송 시간
    @JsonProperty("send_dt")
    private LocalDateTime sendDt;
    //발송 상태
    @JsonProperty("send_status")
    private SENDSTATUS sendStatus;
    //발송 방식
    @JsonProperty("send_type")
    private SENDTYPE sendType;
    // 우편 타입
    @JsonProperty("mail_type")
    private MAILTYPE mailType;
    // 수신 대상 (단일/복수)
    @JsonProperty("receive_type")
    private RECEIVETYPE receiveType;
    // 수신 대상 (GUID/닉네임)
    @JsonProperty("user_type")
    private USERTYPE userType;

    private String guid;
    // 단일 / 복수 ->  guid / 엑셀 경로
    private String target;

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

    public static class Guid{
        String guid;
    }

    public enum SENDTYPE {

        RESERVE_SEND,
        DIRECT_SEND
        ;
    }
    public enum SENDSTATUS {
        WAIT,
        FINISH,
        FAIL,
        RUNNING,
        ;
    }
    public enum MAILTYPE {
        SYSTEM_GUID,
        INSPECTION_COMPENSATION,
        RECOVER_COMPENSATION,
        EVENT_COMPENSATION
        ;
    }
    public enum RECEIVETYPE {
        SINGLE,
        MULTIPLE
        ;
    }
    public enum USERTYPE {
        GUID,
        NICKNAME,
        EMAIL
        ;
    }
}
