K1: add cashbook domain entities + enums
- BookingCategoryType enum (Income/Expense) - CashBookEntryType enum (Income/Expense) - BookingCategory entity - CashBookEntry entity - Club: InitialBalance, MonthlyMembershipFee, navigation props 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4dae965c98
commit
012548e8db
|
|
@ -1699,7 +1699,7 @@ public enum CashBookEntryType { Income = 0, Expense = 1 }
|
|||
|
||||
| ☐ | Phase | Bereich | Beschreibung | Dateien |
|
||||
|---|-------|---------|--------------|---------|
|
||||
| ☐ | K1 | Domain | Entities + Enums | 5 |
|
||||
| ✓ | K1 | Domain | Entities + Enums | 5 |
|
||||
| ☐ | K2 | Infrastructure | EF Configurations | 4 |
|
||||
| ☐ | K3 | Infrastructure | Migration | - |
|
||||
| ☐ | K4 | Security | Kassenwart Role + Policy | 4 |
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
using Koogle.Domain.Enums;
|
||||
|
||||
namespace Koogle.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a booking category for organizing cash book entries.
|
||||
/// </summary>
|
||||
public class BookingCategory : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the club identifier this category belongs to.
|
||||
/// </summary>
|
||||
public Guid ClubId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the category name.
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional description.
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the category type (Income or Expense).
|
||||
/// </summary>
|
||||
public BookingCategoryType CategoryType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether this is a system category (cannot be deleted).
|
||||
/// </summary>
|
||||
public bool IsSystemCategory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the hex color code (#RRGGBB).
|
||||
/// </summary>
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MudBlazor icon name.
|
||||
/// </summary>
|
||||
public string? Icon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether this category is active (soft-deactivation).
|
||||
/// </summary>
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the club navigation property.
|
||||
/// </summary>
|
||||
public Club Club { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cash book entries in this category.
|
||||
/// </summary>
|
||||
public ICollection<CashBookEntry> CashBookEntries { get; set; } = [];
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
using Koogle.Domain.Enums;
|
||||
|
||||
namespace Koogle.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a cash book entry (income or expense transaction).
|
||||
/// </summary>
|
||||
public class CashBookEntry : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the club identifier this entry belongs to.
|
||||
/// </summary>
|
||||
public Guid ClubId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the booking category identifier.
|
||||
/// </summary>
|
||||
public Guid CategoryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the entry type (Income or Expense).
|
||||
/// </summary>
|
||||
public CashBookEntryType EntryType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the amount (always positive).
|
||||
/// </summary>
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the booking date (freely selectable).
|
||||
/// </summary>
|
||||
public DateTime BookingDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional comment.
|
||||
/// </summary>
|
||||
public string? Comment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the receipt reference.
|
||||
/// </summary>
|
||||
public string? ReceiptReference { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional day identifier (for penalty bookings).
|
||||
/// </summary>
|
||||
public Guid? DayId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional person identifier.
|
||||
/// </summary>
|
||||
public Guid? PersonId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the club navigation property.
|
||||
/// </summary>
|
||||
public Club Club { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the category navigation property.
|
||||
/// </summary>
|
||||
public BookingCategory Category { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional day navigation property.
|
||||
/// </summary>
|
||||
public Day? Day { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional person navigation property.
|
||||
/// </summary>
|
||||
public Person? Person { get; set; }
|
||||
}
|
||||
|
|
@ -33,6 +33,16 @@ namespace Koogle.Domain.Entities
|
|||
/// </summary>
|
||||
public string? SenderEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initial cash book balance (opening balance).
|
||||
/// </summary>
|
||||
public decimal InitialBalance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Monthly membership fee amount.
|
||||
/// </summary>
|
||||
public decimal MonthlyMembershipFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Persons in this club.
|
||||
/// </summary>
|
||||
|
|
@ -62,5 +72,15 @@ namespace Koogle.Domain.Entities
|
|||
/// Tokens for anonymous GIF submissions.
|
||||
/// </summary>
|
||||
public ICollection<GifSubmissionToken> GifSubmissionTokens { get; set; } = new List<GifSubmissionToken>();
|
||||
|
||||
/// <summary>
|
||||
/// Booking categories for cash book organization.
|
||||
/// </summary>
|
||||
public ICollection<BookingCategory> BookingCategories { get; set; } = new List<BookingCategory>();
|
||||
|
||||
/// <summary>
|
||||
/// Cash book entries for this club.
|
||||
/// </summary>
|
||||
public ICollection<CashBookEntry> CashBookEntries { get; set; } = new List<CashBookEntry>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
namespace Koogle.Domain.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the type of booking category for cash book entries.
|
||||
/// </summary>
|
||||
public enum BookingCategoryType
|
||||
{
|
||||
/// <summary>
|
||||
/// Income category (e.g., game penalties, membership fees).
|
||||
/// </summary>
|
||||
Income = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Expense category (e.g., lane rental, materials).
|
||||
/// </summary>
|
||||
Expense = 1
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
namespace Koogle.Domain.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the type of cash book entry (income or expense).
|
||||
/// </summary>
|
||||
public enum CashBookEntryType
|
||||
{
|
||||
/// <summary>
|
||||
/// Income entry (money coming in).
|
||||
/// </summary>
|
||||
Income = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Expense entry (money going out).
|
||||
/// </summary>
|
||||
Expense = 1
|
||||
}
|
||||
Loading…
Reference in New Issue