package de.oaa.xxx.social.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

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

@Getter
@Setter
@Entity
@Table(name = "message")
public class MessageEntity {

    @Id
    @Column
    private UUID messageId;

    @Column(nullable = false)
    private UUID senderId;

    @Column(nullable = false)
    private UUID receiverId;

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

    @Column(nullable = false)
    private LocalDateTime sentAt;

    @Column
    private LocalDateTime readAt;

    @Column(nullable = false)
    private boolean systemMessage = false;

    @Enumerated(EnumType.STRING)
    @Column(length = 20)
    private MessageCause messageCause;

    @Column(length = 500)
    private String targetUrl;
}
