package com.caliverse.admin.domain.response;

import com.caliverse.admin.domain.entity.FriendRequest;
import com.caliverse.admin.domain.entity.LANGUAGETYPE;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UsersResponse {
    private int status;

    private String result;
    @JsonProperty("data")
    private ResultData resultData;

    @Data
    @Builder
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ResultData {

        private String message;

        @JsonProperty("user_info")
        private UserInfo userInfo;
        @JsonProperty("char_info")
        private CharInfo charInfo;
        @JsonProperty("avatar_info")
        private AvatarInfo avatarInfo;
        @JsonProperty("cloth_info")
        private ClothInfo clothInfo;
        @JsonProperty("slot_list")
        private SlotInfo slotInfoList;
        @JsonProperty("inventory_list")
        private InventoryInfo inventoryInfo;
        @JsonProperty("mail_list")
        private List<Mail> mailList;
        @JsonProperty("myhome_info")
        private Myhome myhomeInfo;
        @JsonProperty("friend_list")
        private List<Friend> friendList;
        @JsonProperty("friend_send_list")
        private List<Friend> friendSendList;
        @JsonProperty("friend_receive_list")
        private List<Friend> friendReceiveList;
        @JsonProperty("friend_block_list")
        private List<Friend> friendBlockList;
        @JsonProperty("tattoo_list")
        private List<Tattoo> tattooList;
        @JsonProperty("quest_list")
        private List<QuestInfo> questList;
        @JsonProperty("quest_detail")
        private List<Quest> questDetail;

        private Map<String,String> result;
    }
    @Data
    @Builder
    public static class UserInfo{
        private String aid;
        @JsonProperty("user_id")
        private String userId;
        private LANGUAGETYPE nation;
        private String membership;
        //친구 추천코드
        @JsonProperty("friend_code")
        private String friendCode;
        //계정 생성일
        @JsonProperty("create_dt")
        private String createDt;
        //최근 접속일자
        @JsonProperty("access_dt")
        private String accessDt;
        //최근 종료일자
        @JsonProperty("end_dt")
        private String endDt;
        //전자지갑 URL
        @JsonProperty("wallet_url")
        private String walletUrl;
        // GM 타입
        @JsonProperty("admin_level")
        private String adminLevel;
        //예비 슬롯
        @JsonProperty("spare_slot")
        private String spareSlot;
    }
    @Data
    @Builder
    public static class CharInfo{
        //캐릭터 닉네임
        @JsonProperty("character_name")
        private String characterName;
        //시즌 패스 레벨
        private String level;
        //골드
        @JsonProperty("gold_cali")
        private String goldCali;
        //사파이어
        @JsonProperty("blue_cali")
        private String blueCali;
        //칼리움
        @JsonProperty("red_cali")
        private String redCali;
        //루비
        @JsonProperty("black_cali")
        private String blackCali;

    }
    @Data
    @Builder
    public static class AvatarInfo{
        //캐릭터 id
        @JsonProperty("character_id")
        private String characterId;
        //기본 외형
        private String basicstyle;
        //체형 타입
        private String bodyshape;
        //헤어스타일
        private String hairstyle;
        //얼굴 커스터마이징
        private int[] facesCustomizing;
    }
    
    @Data
    @Builder
    public static class ClothItem {
        private String cloth;
        private String clothName;
        @JsonProperty("EquipSlotType")
        private String slotType;
        @JsonProperty("SmallType")
        private String smallType;
    }
//    @Data
//    @Builder
//    public static class ClothItem {
//        private String cloth;
//        private String clothName;
//
//        public void setCloth(String cloth) {
//            this.cloth = cloth;
//        }
//    }

    @Data
    @Builder
    public static class ClothInfo {
        @JsonProperty("cloth_shirt")
        private ClothItem clothShirt;
        @JsonProperty("cloth_dress")
        private ClothItem clothDress;
        @JsonProperty("cloth_outer")
        private ClothItem clothOuter;
        @JsonProperty("cloth_pants")
        private ClothItem clothPants;
        @JsonProperty("cloth_gloves")
        private ClothItem clothGloves;
        @JsonProperty("cloth_ring")
        private ClothItem clothRing;
        @JsonProperty("cloth_bracelet")
        private ClothItem clothBracelet;
        @JsonProperty("cloth_bag")
        private ClothItem clothBag;
        @JsonProperty("cloth_backpack")
        private ClothItem clothBackpack;
        @JsonProperty("cloth_cap")
        private ClothItem clothCap;
        @JsonProperty("cloth_mask")
        private ClothItem clothMask;
        @JsonProperty("cloth_glasses")
        private ClothItem clothGlasses;
        @JsonProperty("cloth_earring")
        private ClothItem clothEarring;
        @JsonProperty("cloth_necklace")
        private ClothItem clothNecklace;
        @JsonProperty("cloth_shoes")
        private ClothItem clothShoes;
        @JsonProperty("cloth_socks")
        private ClothItem clothSocks;
        @JsonProperty("cloth_anklet")
        private ClothItem clothAnklet;
    }
//    public static class ClothInfo { 예전기준
//        @JsonProperty("cloth_avatar")
//        private ClothItem clothAvatar;
//        @JsonProperty("cloth_headwear")
//        private ClothItem clothHeadwear;
//        @JsonProperty("cloth_mask")
//        private ClothItem clothMask;
//        @JsonProperty("cloth_bag")
//        private ClothItem clothBag;
//        @JsonProperty("cloth_shoes")
//        private ClothItem clothShoes;
//        @JsonProperty("cloth_outer")
//        private ClothItem clothOuter;
//        @JsonProperty("cloth_tops")
//        private ClothItem clothTops;
//        @JsonProperty("cloth_bottoms")
//        private ClothItem clothBottoms;
//        @JsonProperty("cloth_gloves")
//        private ClothItem clothGloves;
//        @JsonProperty("cloth_earrings")
//        private ClothItem clothEarrings;
//        @JsonProperty("cloth_neckless")
//        private ClothItem clothNeckless;
//        @JsonProperty("cloth_socks")
//        private ClothItem clothSocks;
//    }

    @Data
    @Builder
    public static class Guid{
        private String guid;
    }

//    public static class InventoryList {
//        @JsonProperty("InventoryTaps")
//        private List<List<String>> inventoryTaps;
//
//        public List<List<String>> getInventoryTaps() {
//            return inventoryTaps;
//        }
//
//        public void setInventoryTaps(List<List<String>> inventoryTaps) {
//            this.inventoryTaps = inventoryTaps;
//        }
//    }

    @Builder
    @Data
    public static class InventoryInfo{
        private List<Item> cloth;
        private List<Item> prop;
        private List<Item> beauty;
        private List<Item> tattoo;
        private List<Item> currency;
        private List<Item> etc;
    }
    @Data
    public static class Myhome{
        @JsonProperty("myhome_guid")
        private String myhomeGuid;
        @JsonProperty("myhome_name")
        private String myhomeName;
        @JsonProperty("prop_list")
        private List<Item> propList;
    }
    @Data
    public static class Tattoo{
        @JsonProperty("item_guid")
        private String itemGuid;
        @JsonProperty("item_id")
        private Long itemId;
        @JsonProperty("item_name")
        private String itemName;
        private Double count;
        private Integer level;
        private Integer slot;
    }
    @Data
    @Builder
    public static class Item{
        @JsonProperty("item_id")
        private String itemId;
        private Double count;
        @JsonProperty("item_name")
        private String itemName;
        @JsonProperty("item_guid")
        private String itemGuid;
    }
    @Data
    @Builder
    public static class ToolItem{
        @JsonProperty("tool_id")
        private String toolId;
        @JsonProperty("tool_name")
        private String toolName;
    }
    @Data
    @Builder
    public static class SlotInfo{
        private ToolItem Slot1;
        private ToolItem Slot2;
        private ToolItem Slot3;
        private ToolItem Slot4;
    }
    @Data
    @Builder
    public static class QuestInfo{
        @JsonProperty("quest_id")
        private Integer questId;
        @JsonProperty("quest_name")
        private String questName;
        @JsonProperty("quest_assign_time")
        private String assignTime;
        @JsonProperty("task_start_time")
        private String startTime;
        @JsonProperty("quest_complete_time")
        private String completeTime;
        private String giveUpTime;
        @JsonProperty("quest_type")
        private String type;
        @JsonProperty("current_task_num")
        private Integer currentTaskNum;
        private String status;
        private List<Quest> detailQuest;
    }
    @Data
    @Builder
    public static class Quest{
        @JsonProperty("row_num")
        private Long rowNum;
        @JsonProperty("quest_id")
        private Integer questId;
        @JsonProperty("quest_name")
        private String questName;
        private String type;
        private String status;
        @JsonProperty("task_no")
        private Integer taskNo;
        @JsonProperty("task_name")
        private String taskName;
        private Integer counter;

    }
    @Data
    public static class Friend{
        @JsonProperty("row_num")
        private int rowNum;
        @JsonProperty("friend_name")
        private String friendName;
        @JsonProperty("friend_guid")
        private String friendGuid;
        private String language;
        @JsonProperty("receive_dt")
        private String receiveDt;
    }
//    @Data
//    public static class Mail{
//        @JsonProperty("receive_dt")
//        private LocalDateTime receiveDt;
//        @JsonProperty("sender_nickname")
//        private String senderNickname;
//        private String title;
//        private String content;
//        private String status;
//        @JsonProperty("has_attachment")
//        private boolean hasAttachment;
//        @JsonProperty("is_get_item")
//        private boolean isGetItem;
//        @JsonProperty("is_get_item_dt")
//        private LocalDateTime isGetItemDt;
//
//        @JsonProperty("item_list")
//        private List<MailItem> mailItemList;
//    }
    @Data
    @Builder
    public static class Mail{
        @JsonProperty("mail_guid")
        private String mailGuid;
        @JsonProperty("create_time")
        private String createDt;
        private String title;
        private String content;
        @JsonProperty("receiver_nickname")
        private String receiveNickname;
        @JsonProperty("sender_nickname")
        private String senderNickname;
        private boolean status;
        @JsonProperty("is_get_item")
        private boolean isGetItem;
        @JsonProperty("is_system_mail")
        private boolean isSystemMail;
        @JsonProperty("item_list")
        private List<MailItem> mailItemList;
    }
    @Data
    public static class MailItem {
        @JsonProperty("item_id")
        private String itemId;
        @JsonProperty("item_name")
        private String itemName;
        private double count;
    }

}
