package com.alterdekim.game.entity;


import com.alterdekim.flash.decompiler.mapper.FlashClass;
import com.alterdekim.flash.decompiler.mapper.FlashField;
import com.alterdekim.flash.decompiler.mapper.FlashValue;
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
import com.alterdekim.game.component.game.CatalogType;
import com.alterdekim.game.mapper.String2CatalogTypeConverter;
import com.alterdekim.game.mapper.String2DateConverter;
import jakarta.persistence.*;
import lombok.*;

import java.time.LocalDateTime;
import java.util.Date;

@ToString
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="catalogs")
@FlashClass(name = "c")
public class Catalog {
    @Id
    @FlashValue(type = FlashValueType.Id)
    private Long id;

    @Enumerated(EnumType.STRING)
    @FlashField(name = "Type", useCustomConverter = true, converter = String2CatalogTypeConverter.class)
    private CatalogType type;

    @Column(nullable = true)
    @FlashField(name = "TRId")
    private Integer trId;

    @Column(nullable = true)
    @FlashField(name = "MRId")
    private Integer mrId;

    @Column(nullable = true)
    @FlashField(name = "Tag")
    private Integer tag;

    @Column(nullable = true)
    @FlashField(name = "PublishDate", useCustomConverter = true, converter = String2DateConverter.class)
    private LocalDateTime publishDate;
}
