package de.cannamanage.domain.entity;

import jakarta.persistence.*;

import java.time.Instant;
import java.util.UUID;

/**
 * File attachment for an info board post.
 * MVP: table created but upload not yet implemented.
 */
@Entity
@Table(name = "post_attachments", indexes = {
    @Index(name = "idx_post_attachments_post_id", columnList = "post_id")
})
public class PostAttachment extends AbstractTenantEntity {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "post_id", nullable = false)
    private InfoBoardPost post;

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

    @Column(name = "content_type", length = 100)
    private String contentType;

    @Column(name = "file_size")
    private Long fileSize;

    @Column(name = "storage_path", nullable = false, length = 500)
    private String storagePath;

    public PostAttachment() {}

    // Getters and setters

    public InfoBoardPost getPost() { return post; }
    public void setPost(InfoBoardPost post) { this.post = post; }

    public String getFilename() { return filename; }
    public void setFilename(String filename) { this.filename = filename; }

    public String getContentType() { return contentType; }
    public void setContentType(String contentType) { this.contentType = contentType; }

    public Long getFileSize() { return fileSize; }
    public void setFileSize(Long fileSize) { this.fileSize = fileSize; }

    public String getStoragePath() { return storagePath; }
    public void setStoragePath(String storagePath) { this.storagePath = storagePath; }
}
