using System.ComponentModel.DataAnnotations;

namespace GerbilManagerWebAPI.Models
{
    /// <summary>
    /// An image/file attached to a feedback ticket (z. B. ein Foto vom Tier/Fellschlag/Stammbaum).
    /// Like <see cref="Feedback"/> it is decoupled (loose FeedbackId, no FK) so it survives the
    /// import re-ingest wipe. The bytes live in the DB (single-user app, gelegentliche Fotos) —
    /// die Liste GET /feedback liefert nur Metadaten, die Bytes kommen über einen eigenen Endpoint.
    /// </summary>
    public class FeedbackAttachment
    {
        [Key]
        public Guid Id { get; set; }

        /// <summary>Loose reference (no FK) to the feedback ticket this belongs to.</summary>
        public Guid FeedbackId { get; set; }

        public required string FileName { get; set; }

        public required string ContentType { get; set; }

        /// <summary>Größe in Bytes (separat gespeichert, damit Listen-Abfragen die Bytes nicht laden).</summary>
        public int Size { get; set; }

        /// <summary>The raw file bytes.</summary>
        public required byte[] Data { get; set; }

        public DateTimeOffset CreatedAt { get; set; }
    }
}
