using System.ComponentModel.DataAnnotations;
namespace GerbilManagerWebAPI.Models
{
///
/// FEEDBACK: a user-submitted "Fehler melden" report. Decoupled from the rest of the
/// model on purpose — GerbilId/LitterId are plain nullable Guid columns (NOT enforced
/// foreign keys), so the import re-ingest wipe (IngestResolvedService) can delete
/// gerbils/litters without deleting or breaking feedback rows. The captured EntityName
/// keeps the report human-readable even after the referenced animal is gone.
///
public class Feedback
{
[Key]
public Guid Id { get; set; }
/// The user's free-text description of the problem.
public required string Message { get; set; }
/// Which view the report came from: stammbaum | gerbil-detail | litter-detail.
public required string Context { get; set; }
/// Loose reference (no FK) to the gerbil the report is about, if any.
public Guid? GerbilId { get; set; }
/// Loose reference (no FK) to the litter the report is about, if any.
public Guid? LitterId { get; set; }
/// Loose reference (no FK) to the contact the report is about, if any.
public Guid? ContactId { get; set; }
/// Captured name of the referenced animal/litter (survives an ingest wipe).
public string? EntityName { get; set; }
/// The client URL/route the report was filed from.
public string? Url { get; set; }
/// Client-supplied timestamp (when the user submitted, in their browser).
public DateTimeOffset? ClientTimestamp { get; set; }
/// Optional browser user-agent for diagnostics.
public string? UserAgent { get; set; }
/// Server-side creation time.
public DateTimeOffset CreatedAt { get; set; }
///
/// Ticket lifecycle status: "Open" | "Resolved" (default "Open"). Plain string,
/// no FK — keeps feedback decoupled and ingest-surviving like the rest of the row.
///
public string Status { get; set; } = "Open";
/// When the ticket was marked resolved; null while open.
public DateTimeOffset? ResolvedAt { get; set; }
}
}