package com.caliverse.admin.domain.entity.metadata;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.List;

@Data
public class MetaCraftingData {
    @JsonProperty("Id")
    private int id;

    @JsonProperty("PropSmallType")
    private String propSmallType;

    @JsonProperty("Crafting_ItemId")
    private int craftingItemId;

    @JsonProperty("Crafting_ItemValue")
    private int craftingItemValue;

    @JsonProperty("RecipeType")
    private String recipeType;

    @JsonProperty("Recipe_ItemId")
    private int recipeItemId;

    @JsonProperty("Material")
    private List<Material> materials;

    @JsonProperty("Attribute")
    private List<Attribute> attributes;

    @JsonProperty("Prop")
    private List<Integer> props;

    @JsonProperty("CraftingTime")
    private int craftingTime;

    @JsonProperty("Beacon_ReduceTime")
    private int beaconReduceTime;

    @JsonProperty("Beacon_BonusItemId")
    private int beaconBonusItemId;

    @JsonProperty("max_craft_limit")
    private int maxCraftLimit;
    @Data
    public static class Material {
        @JsonProperty("ItemId")
        private int itemId;

        @JsonProperty("ItemValue")
        private int itemValue;

        @Override
        public String toString() {
            return String.format("(ItemId=%d,ItemValue=%d)", itemId, itemValue);
        }
    }

    @Data
    public static class Attribute {
        @JsonProperty("AttributeName")
        private String attributeName;

        @JsonProperty("AttributeValue")
        private int attributeValue;

        @Override
        public String toString() {
            return String.format("(AttributeName=%s,AttributeValue=%d)", attributeName, attributeValue);
        }
    }
}
