package app.mealsmadeeasy.api.file;

import app.mealsmadeeasy.api.user.User;
import jakarta.persistence.*;
import lombok.Data;

import java.time.OffsetDateTime;
import java.util.UUID;

@Entity
@Table(name = "file")
@Data
public class File {

    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    @Column(nullable = false, updatable = false)
    private UUID id;

    @Column(nullable = false, updatable = false)
    private OffsetDateTime created;

    @Column(nullable = false)
    private String userFilename;

    @Column(nullable = false, updatable = false)
    private String mimeType;

    @Column(nullable = false, updatable = false)
    private String objectName;

    @ManyToOne(optional = false)
    @JoinColumn(name = "owner_id", nullable = false)
    private User owner;

}
