feat(tier): Erwerb/Kauf je Tier (Datum, Preis, Notiz)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 22:43:18 +02:00
parent 5e14124322
commit 55e79cda51
16 changed files with 2360 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using System.ComponentModel.DataAnnotations;
namespace GerbilManagerWebAPI.Models
{
/// <summary>
/// ERWERB: how/when an animal was acquired (purchase date, price, note) — sourced from
/// RennmausPro's <c>herktier_tb</c> (_TID/_DATE/_PRICE/_BEM). The seller is already linked
/// via Gerbil.OriginContactId; this record adds the date/price/note around that.
///
/// Decoupled from the rest of the model ON PURPOSE — GerbilId/SourceContactId are plain
/// nullable Guid columns (NOT enforced foreign keys), so the import re-ingest wipe
/// (IngestResolvedService, which deletes Gerbils/Contacts) never cascades into — or
/// breaks — acquisition rows. They survive re-ingest, mirroring the Feedback pattern.
/// </summary>
public class AcquisitionRecord
{
[Key]
public Guid Id { get; set; }
/// <summary>Loose reference (no FK) to the acquired gerbil.</summary>
public Guid? GerbilId { get; set; }
/// <summary>Loose reference (no FK) to the source/seller contact, if known.</summary>
public Guid? SourceContactId { get; set; }
/// <summary>When the animal was acquired (purchase date).</summary>
public DateOnly? Date { get; set; }
/// <summary>Acquisition price (purchase cost), if recorded.</summary>
public decimal? Price { get; set; }
/// <summary>Free-text note about the acquisition.</summary>
public string? Note { get; set; }
/// <summary>Server-side creation time.</summary>
public DateTimeOffset CreatedAt { get; set; }
}
}