Files
LehrerApp/LehrerApp.Core/Models/Student.cs

61 lines
2.0 KiB
C#

namespace LehrerApp.Core.Models;
public class Student
{
public Guid Id { get; set; } = Guid.NewGuid();
public string FirstName { get; set; } = "";
public string LastName { get; set; } = "";
public string FullName => $"{LastName}, {FirstName}";
public DateOnly? DateOfBirth { get; set; }
public Gender? Gender { get; set; }
/// <summary>Quellsystembezogene Kennungen, z.B. für wiederholbare Stammdatenimporte.</summary>
public Dictionary<string, string> ExternalIds { get; set; } = [];
public List<Contact> Contacts { get; set; } = [];
public string? Notes { get; set; }
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public class Contact
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Name { get; set; } = "";
public string Relation { get; set; } = "";
/// <summary>Vollständige Anrede für Briefe, z.B. „Sehr geehrte Frau Mustermann,“.</summary>
public string? LetterSalutation { get; set; }
public string? Phone { get; set; }
public string? MobilePhone { get; set; }
public string? Email { get; set; }
public string? Street { get; set; }
public string? PostalCode { get; set; }
public string? City { get; set; }
public DateOnly? InvalidSince { get; set; }
public ContactInvalidReason? InvalidReason { get; set; }
public string? InvalidReasonDetails { get; set; }
}
public enum ContactInvalidReason
{
Moved,
NewPhoneNumber,
LostCustody,
NewEmailAddress,
NoLongerResponsible,
Other,
}
public enum Gender { M, W, D }
public sealed record StudentReferenceSummary(
int Memberships,
int ExamResults,
int Grades,
int ReportGrades,
int ParticipationEntries,
int DocumentationEntries)
{
public int Total => Memberships + ExamResults + Grades + ReportGrades
+ ParticipationEntries + DocumentationEntries;
public bool HasReferences => Total > 0;
}