Files
GerbilManager/GerbilManagerWebAPI/Models/Enclosure.cs

32 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.ComponentModel.DataAnnotations;
namespace GerbilManagerWebAPI.Models
{
/// <summary>A tank/cage (Becken) that gerbils currently live in.</summary>
public class Enclosure
{
[Key]
public Guid Id { get; set; }
public required string Name { get; set; }
public string? Notes { get; set; }
// Reinigungszyklus (aus RennmausPro becken_tb: _SIZE/_MENGE/_CLEANED/_CYCLUS).
/// <summary>Maße als Freitext (z. B. "120×50 cm").</summary>
public string? Size { get; set; }
/// <summary>Empfohlene/maximale Tieranzahl.</summary>
public int? Capacity { get; set; }
/// <summary>Datum der letzten Reinigung.</summary>
public DateOnly? LastCleanedDate { get; set; }
/// <summary>Reinigungsintervall in Tagen.</summary>
public int? CleaningCycleDays { get; set; }
/// <summary>Nächste fällige Reinigung = LastCleanedDate + CleaningCycleDays (berechnet, nicht persistiert).</summary>
public DateOnly? NextCleaningDate =>
LastCleanedDate is { } last && CleaningCycleDays is { } cycle and > 0
? last.AddDays(cycle)
: null;
public ICollection<Gerbil> Gerbils { get; } = new List<Gerbil>();
}
}