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:
beo3000 2026-01-03 14:16:59 +01:00
parent 4dae965c98
commit 012548e8db
6 changed files with 188 additions and 1 deletions

View File

@ -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 |

View File

@ -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; } = [];
}

View File

@ -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; }
}

View File

@ -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>();
}
}

View File

@ -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
}

View File

@ -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
}