package com.sikey.wa04.business.infrastructure.dto.model;

import cn.hutool.json.JSON;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;

import java.time.Instant;
import java.util.Map;

@Getter
@Setter
@Entity
@Table(name = "tb_message_center")
public class MessageCenterModel extends BaseModel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    @NotNull
    @Column(name = "children_id", nullable = false)
    private String childrenId;

    @NotNull
    @Column(name = "message_type", nullable = false)
    private Integer messageType;

    @NotNull
    @Column(name = "message_params", nullable = false)
    @JdbcTypeCode(SqlTypes.JSON)
    private Map<String, Object> messageParams;

    @Column(name = "send_time")
    private Instant sendTime;

    @Column(name = "deleted_at")
    private Instant deletedAt;

}