package com.alterdekim.game.entity;


import com.alterdekim.game.component.game.AvatarInventoryType;
import com.alterdekim.game.repository.UserRepository;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import jakarta.persistence.*;
import lombok.*;
import org.springframework.beans.factory.annotation.Autowired;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="avatar_inventory")
public class AvatarInventory {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long Id;

    @OneToOne
    @JoinColumn(referencedColumnName = "id")
    private User user;

    @Column(nullable = false)
    private Long goodId;

    @Column(nullable = false)
    private Boolean isUsed;

    @Enumerated(value = EnumType.STRING)
    private AvatarInventoryType type;

    @Column(nullable = false)
    private Integer color = 0;

    public AvatarInventory(User user, Long goodId, Boolean isUsed, AvatarInventoryType type) {
        this.user = user;
        this.goodId = goodId;
        this.isUsed = isUsed;
        this.type = type;
    }

    public AvatarInventory(User user, Long goodId, Boolean isUsed, AvatarInventoryType type, Integer color) {
        this.user = user;
        this.goodId = goodId;
        this.isUsed = isUsed;
        this.type = type;
        this.color = color;
    }
}