package de.oaa.xxx.hashtag;

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

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

@Getter
@Setter
@Entity
@Table(name = "post_hashtag", indexes = {
    @Index(name = "idx_ph_hashtag", columnList = "hashtagId"),
    @Index(name = "idx_ph_post",    columnList = "postType, postId")
})
public class PostHashtagEntity {

    @Id
    @Column
    private UUID id;

    @Column(nullable = false)
    private UUID hashtagId;

    /** "FEED" or "GROUP" */
    @Column(nullable = false, length = 10)
    private String postType;

    @Column(nullable = false)
    private UUID postId;

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