- Kontakt-Detailseite: „Fehler melden"- und „Datenherkunft"-Button. - Wurf-Ansicht: „Datenherkunft"-Button (Feedback war bereits vorhanden). - Feedback-Entity um loses, nullable ContactId erweitert (kein FK → übersteht Ingest-Wipe); Migration AddFeedbackContactId. - Contact.Provenance + Litter.Provenance (nullable text); Migration AddContactLitterProvenance; im Ingest gemappt und in den DTOs zurückgegeben. - Import: build_entity_provenance() generalisiert; Kontakte (sourceFiles, Züchter/Abnehmer-Hinweise) und Würfe (Wurfchronik vs. Diagramm-rekonstruiert, Geschwister-Merge) erhalten Herkunftsdaten in resolved_import.json. - Frontend: ProvenanceDialog generalisiert (EntityProvenance + entityLabel). Tests erweitert (Ingest-Round-trip Kontakt/Wurf, contact-scoped Feedback übersteht Wipe). dotnet(212)/vitest(129)/playwright(36)/tsc/eslint grün. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
48 lines
2.0 KiB
C#
48 lines
2.0 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace GerbilManagerWebAPI.Models
|
|
{
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public class Feedback
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>The user's free-text description of the problem.</summary>
|
|
public required string Message { get; set; }
|
|
|
|
/// <summary>Which view the report came from: stammbaum | gerbil-detail | litter-detail.</summary>
|
|
public required string Context { get; set; }
|
|
|
|
/// <summary>Loose reference (no FK) to the gerbil the report is about, if any.</summary>
|
|
public Guid? GerbilId { get; set; }
|
|
|
|
/// <summary>Loose reference (no FK) to the litter the report is about, if any.</summary>
|
|
public Guid? LitterId { get; set; }
|
|
|
|
/// <summary>Loose reference (no FK) to the contact the report is about, if any.</summary>
|
|
public Guid? ContactId { get; set; }
|
|
|
|
/// <summary>Captured name of the referenced animal/litter (survives an ingest wipe).</summary>
|
|
public string? EntityName { get; set; }
|
|
|
|
/// <summary>The client URL/route the report was filed from.</summary>
|
|
public string? Url { get; set; }
|
|
|
|
/// <summary>Client-supplied timestamp (when the user submitted, in their browser).</summary>
|
|
public DateTimeOffset? ClientTimestamp { get; set; }
|
|
|
|
/// <summary>Optional browser user-agent for diagnostics.</summary>
|
|
public string? UserAgent { get; set; }
|
|
|
|
/// <summary>Server-side creation time.</summary>
|
|
public DateTimeOffset CreatedAt { get; set; }
|
|
}
|
|
}
|