94 lines
2.4 KiB
C#
94 lines
2.4 KiB
C#
using Koogle.Domain.Enums;
|
|
|
|
namespace Koogle.Domain.Entities;
|
|
|
|
/// <summary>
|
|
/// 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)
|
|
/// </summary>
|
|
public class PersonExpense : BaseEntity
|
|
{
|
|
// Zuordnungen
|
|
|
|
/// <summary>
|
|
/// ID that refers to a Person who has the Expense
|
|
/// </summary>
|
|
public Guid PersonId { get; set; } // Foreign Key
|
|
|
|
/// <summary>
|
|
/// ID that refers to an Expense assigned to the Person
|
|
/// </summary>
|
|
public Guid ExpenseId { get; set; } // Foreign Key
|
|
|
|
/// <summary>
|
|
/// ID that refers to a Day when Expense is assigned
|
|
/// </summary>
|
|
public Guid DayId { get; set; } // Foreign Key
|
|
|
|
/// <summary>
|
|
/// optional ID that to a Game if Expense is related to a specific Game
|
|
/// </summary>
|
|
public Guid? GameId { get; set; } // Foreign Key
|
|
|
|
// Stammdaten
|
|
|
|
/// <summary>
|
|
/// Copy of Expense Name for historical records
|
|
/// </summary>
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the current expense status for the person.
|
|
/// </summary>
|
|
public PersonExpenseStatus PersonExpenseStatus { get; set; }
|
|
|
|
/// <summary>
|
|
/// copies ExpenseType for historical records
|
|
/// </summary>
|
|
public ExpenseType ExpenseType { get; set; }
|
|
|
|
/// <summary>
|
|
/// copies Price for historical records
|
|
/// </summary>
|
|
public decimal Price { get; set; }
|
|
|
|
|
|
|
|
|
|
// Navigation Properties
|
|
|
|
/// <summary>
|
|
/// Id of a club.
|
|
/// </summary>
|
|
public Guid ClubId { get; set; }
|
|
|
|
/// <summary>
|
|
/// ID des Benutzers, der die Zuordnung vorgenommen hat.
|
|
/// </summary>
|
|
public Guid AssignedById { get; set; }
|
|
|
|
/// <summary>
|
|
/// the Person who has the Expense
|
|
/// </summary>
|
|
public Person Person { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// the Day when the Expense is assigned
|
|
/// </summary>
|
|
public Day Day { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// the Expense assigned to the Person
|
|
/// </summary>
|
|
public Expense Expense { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// optional reference to the Game if Expense is related to a specific Game
|
|
/// </summary>
|
|
public Game? Game { get; set; } = null;
|
|
|
|
/// <summary>
|
|
/// associated Club.
|
|
/// </summary>
|
|
public Club Club { get; set; } = null!;
|
|
} |