package com.smyhub.store.mengyastorebackendjava.entity;

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

import java.time.LocalDateTime;

@Entity
@Table(name = "chat_messages")
@Getter
@Setter
public class ChatMessage {

    @Id
    @Column(length = 36)
    private String id;

    @Column(name = "account_id", length = 255, nullable = false)
    private String accountId;

    @Column(name = "account_name", length = 255)
    private String accountName;

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

    @Column(name = "sent_at", nullable = false)
    private LocalDateTime sentAt;

    @Column(name = "from_admin", columnDefinition = "tinyint(1) default 0")
    private boolean fromAdmin;
}
