using Koogle.Domain.Enums;
namespace Koogle.Domain.Entities;
///
/// Join-Entity für die Many-to-Many-Beziehung zwischen Person und Expense als eigene Enitity (ohne Composite-Key)
/// Dieselbe Expense könnte einer Person am gleichen Tag mehrfach zugeordnet werden (z.B. mehrfaches Ereignis)
///
public class PersonExpense : BaseEntity
{
// Zuordnungen
///
/// ID that refers to a Person who has the Expense
///
public Guid PersonId { get; set; } // Foreign Key
///
/// ID that refers to an Expense assigned to the Person
///
public Guid ExpenseId { get; set; } // Foreign Key
///
/// ID that refers to a Day when Expense is assigned
///
public Guid DayId { get; set; } // Foreign Key
///
/// optional ID that to a Game if Expense is related to a specific Game
///
public Guid? GameId { get; set; } // Foreign Key
// Stammdaten
///
/// Copy of Expense Name for historical records
///
public string Name { get; set; } = string.Empty;
///
/// Gets or sets the current expense status for the person.
///
public PersonExpenseStatus PersonExpenseStatus { get; set; }
///
/// copies ExpenseType for historical records
///
public ExpenseType ExpenseType { get; set; }
///
/// copies Price for historical records
///
public decimal Price { get; set; }
// Navigation Properties
///
/// Id of a club.
///
public Guid ClubId { get; set; }
///
/// ID des Benutzers, der die Zuordnung vorgenommen hat.
///
public Guid AssignedById { get; set; }
///
/// the Person who has the Expense
///
public Person Person { get; set; } = null!;
///
/// the Day when the Expense is assigned
///
public Day Day { get; set; } = null!;
///
/// the Expense assigned to the Person
///
public Expense Expense { get; set; } = null!;
///
/// optional reference to the Game if Expense is related to a specific Game
///
public Game? Game { get; set; } = null;
///
/// associated Club.
///
public Club Club { get; set; } = null!;
}