package de.oaa.xxx.gruppe.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 = "gruppe_beitrag")
public class GruppenbeitragEntity {

    @Id
    @Column
    private UUID beitragId;

    @Column(nullable = false)
    private UUID gruppeId;

    @Column(nullable = false)
    private UUID authorId;

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

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

    @Column
    private Boolean multiChoice;

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

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