package ai.decompile.workspace.model.entity;

import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;

@Entity
@Table(name = "binary_dependencies")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BinaryDependency {
  @Id
  @GeneratedValue(strategy = GenerationType.UUID)
  private UUID id;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "binary_id", nullable = false)
  private Binary binary;

  @Column(nullable = false)
  private String filename;

  @Column(name = "file_size", nullable = false)
  private long fileSize;

  @Column(name = "file_path", nullable = false, length = 500)
  private String filePath;

  @CreationTimestamp
  @Column(name = "created_at", nullable = false, updatable = false)
  private Instant createdAt;
}
