package de.oaa.xxx.feed.entity;

import de.oaa.xxx.config.StringListConverter;
import de.oaa.xxx.gruppe.BeitragTyp;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

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

@Getter
@Setter
@Entity
@Table(name = "feed_post")
public class FeedPostEntity {

    @Id
    @Column
    private UUID postId;

    @Column(nullable = false)
    private UUID authorId;

    @Column(columnDefinition = "TEXT")
    private String text;

    @Convert(converter = StringListConverter.class)
    @Column(name = "bild", columnDefinition = "MEDIUMTEXT")
    private List<String> bilder;

    @Enumerated(EnumType.STRING)
    @Column(nullable = false, length = 10)
    private BeitragTyp beitragTyp;

    @Column
    private Boolean multiChoice;

    @Column(nullable = false)
    private boolean isPublic;

    @Column(nullable = false)
    private LocalDateTime createdAt;
}
