- 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>
116 lines
3.9 KiB
C#
116 lines
3.9 KiB
C#
using GerbilManagerWebAPI.Models;
|
|
|
|
namespace GerbilManagerWebAPI.Dtos
|
|
{
|
|
// Response DTOs ----------------------------------------------------------
|
|
// Enums serialise as string names; JSON property names are camelCase (configured
|
|
// globally in Program.cs). FK references are FLAT ids (no nested objects) per the
|
|
// frontend contract (Kelly's pedigree + Oscar's filters depend on this).
|
|
|
|
public record GerbilDto(
|
|
Guid Id,
|
|
string Name,
|
|
Gender Gender,
|
|
GerbilStatus Status,
|
|
Guid? LitterId,
|
|
Guid? OriginContactId,
|
|
Guid? ReceiverContactId,
|
|
Guid? EnclosureId,
|
|
Guid? ColorVarietyId,
|
|
DateOnly? DateOfBirth,
|
|
DateOnly? DateOfDeath,
|
|
string? CauseOfDeath,
|
|
DateOnly? GoHomeDate,
|
|
string? Genotype,
|
|
string? SpottingType,
|
|
string? Notes,
|
|
string? ImportSource,
|
|
string? ExternalRef,
|
|
string? OriginBreeder,
|
|
List<string> CharacterTraits,
|
|
string? CharacterNote,
|
|
bool? IsDeaf,
|
|
bool IsResident,
|
|
string? ProfilePhotoUrl,
|
|
bool IsCastrated,
|
|
string? Provenance);
|
|
|
|
public record LitterDto(
|
|
Guid Id,
|
|
string Name,
|
|
DateOnly? Date,
|
|
int? TotalBorn,
|
|
int? DeathsWithin8Weeks,
|
|
Guid? FatherId,
|
|
Guid? MotherId,
|
|
DateOnly? ExpectedGoHomeDate,
|
|
string? Notes,
|
|
string? Provenance);
|
|
|
|
public record ContactDto(Guid Id, string Name, string? Email, string? Phone, string? Address, string? Notes, bool IsBreeder, bool IsReceiver, string? NameSuffix, string? Provenance);
|
|
|
|
public record EnclosureDto(Guid Id, string Name, string? Notes);
|
|
|
|
public record ColorVarietyDto(Guid Id, string Name, string? CanonicalGenotype, int SortOrder);
|
|
|
|
public record HealthRecordDto(
|
|
Guid Id, Guid GerbilId, DateOnly Date, HealthRecordType Type,
|
|
string Description, string? Veterinarian, DateTimeOffset CreatedAt);
|
|
|
|
public record WeightRecordDto(
|
|
Guid Id, Guid GerbilId, DateOnly Date, int WeightGrams, string? Notes);
|
|
|
|
public record PhotoDto(Guid Id, string FileName, string? Caption, int SortOrder, string Url);
|
|
|
|
// Request DTOs -----------------------------------------------------------
|
|
|
|
public record GerbilInput(
|
|
string? Name,
|
|
Gender? Gender,
|
|
GerbilStatus? Status,
|
|
Guid? LitterId,
|
|
Guid? OriginContactId,
|
|
Guid? ReceiverContactId,
|
|
Guid? EnclosureId,
|
|
Guid? ColorVarietyId,
|
|
DateOnly? DateOfBirth,
|
|
DateOnly? DateOfDeath,
|
|
string? CauseOfDeath,
|
|
DateOnly? GoHomeDate,
|
|
string? Genotype,
|
|
string? SpottingType,
|
|
string? Notes,
|
|
string? ImportSource,
|
|
string? ExternalRef,
|
|
string? OriginBreeder,
|
|
List<string>? CharacterTraits,
|
|
string? CharacterNote,
|
|
bool? IsDeaf,
|
|
bool? IsResident,
|
|
bool? IsCastrated);
|
|
|
|
public record LitterInput(
|
|
string Name,
|
|
DateOnly? Date,
|
|
int? TotalBorn,
|
|
int? DeathsWithin8Weeks,
|
|
Guid? FatherId,
|
|
Guid? MotherId,
|
|
DateOnly? ExpectedGoHomeDate,
|
|
string? Notes);
|
|
|
|
public record ContactInput(string Name, string? Email, string? Phone, string? Address, string? Notes, bool IsBreeder, bool IsReceiver, string? NameSuffix);
|
|
|
|
public record EnclosureInput(string Name, string? Notes);
|
|
|
|
public record ColorVarietyInput(string Name, string? CanonicalGenotype, int? SortOrder);
|
|
|
|
public record HealthRecordInput(
|
|
Guid GerbilId, DateOnly Date, HealthRecordType Type, string Description, string? Veterinarian);
|
|
|
|
public record WeightRecordInput(Guid GerbilId, DateOnly Date, int WeightGrams, string? Notes);
|
|
|
|
/// <summary>Hypothetical pairing request for POST /genetics/test-inbreeding.</summary>
|
|
public record TestInbreedingDto(Guid? FatherId, Guid? MotherId);
|
|
}
|