K6: add cashbook DTOs

- BookingCategoryDto, CreateBookingCategoryDto, UpdateBookingCategoryDto
- CashBookEntryDto, CreateCashBookEntryDto, UpdateCashBookEntryDto
- CashBookReportDto, CategorySummaryDto, CreateMembershipFeesDto
This commit is contained in:
beo3000 2026-01-03 14:39:40 +01:00
parent 9c4a6f2ab6
commit 96c5b4d196
4 changed files with 131 additions and 1 deletions

View File

@ -1704,7 +1704,7 @@ public enum CashBookEntryType { Income = 0, Expense = 1 }
| ✓ | K3 | Infrastructure | Migration | - |
| ✓ | K4 | Security | Kassenwart Role + Policy | 4 |
| ✓ | K5 | Infrastructure | Repositories | 5 |
| | K6 | Application | DTOs | 3 |
| | K6 | Application | DTOs | 3 |
| ☐ | K7 | Application | Service Interfaces | 2 |
| ☐ | K8 | Application | Service Implementations | 4 |
| ☐ | K9 | Application | Category Seeder | 1 |

View File

@ -0,0 +1,43 @@
using Koogle.Domain.Enums;
namespace Koogle.Application.DTOs;
/// <summary>
/// Data transfer object representing a booking category.
/// </summary>
public record BookingCategoryDto
{
public Guid Id { get; init; }
public string Name { get; init; } = string.Empty;
public string? Description { get; init; }
public BookingCategoryType CategoryType { get; init; }
public bool IsSystemCategory { get; init; }
public string? Color { get; init; }
public string? Icon { get; init; }
public bool IsActive { get; init; }
}
/// <summary>
/// Data transfer object for creating a new booking category.
/// </summary>
public record CreateBookingCategoryDto
{
public string Name { get; init; } = string.Empty;
public string? Description { get; init; }
public BookingCategoryType CategoryType { get; init; }
public string? Color { get; init; }
public string? Icon { get; init; }
}
/// <summary>
/// Data transfer object for updating an existing booking category.
/// </summary>
public record UpdateBookingCategoryDto
{
public Guid Id { get; init; }
public string Name { get; init; } = string.Empty;
public string? Description { get; init; }
public string? Color { get; init; }
public string? Icon { get; init; }
public bool IsActive { get; init; }
}

View File

@ -0,0 +1,49 @@
using Koogle.Domain.Enums;
namespace Koogle.Application.DTOs;
/// <summary>
/// Data transfer object representing a cash book entry.
/// </summary>
public record CashBookEntryDto
{
public Guid Id { get; init; }
public Guid CategoryId { get; init; }
public string CategoryName { get; init; } = string.Empty;
public CashBookEntryType EntryType { get; init; }
public decimal Amount { get; init; }
public DateTime BookingDate { get; init; }
public string? Comment { get; init; }
public string? ReceiptReference { get; init; }
public Guid? DayId { get; init; }
public Guid? PersonId { get; init; }
public string? PersonName { get; init; }
public DateTime CreatedAt { get; init; }
}
/// <summary>
/// Data transfer object for creating a new cash book entry.
/// </summary>
public record CreateCashBookEntryDto
{
public Guid CategoryId { get; init; }
public CashBookEntryType EntryType { get; init; }
public decimal Amount { get; init; }
public DateTime BookingDate { get; init; }
public string? Comment { get; init; }
public string? ReceiptReference { get; init; }
public Guid? PersonId { get; init; }
}
/// <summary>
/// Data transfer object for updating an existing cash book entry.
/// </summary>
public record UpdateCashBookEntryDto
{
public Guid Id { get; init; }
public Guid CategoryId { get; init; }
public decimal Amount { get; init; }
public DateTime BookingDate { get; init; }
public string? Comment { get; init; }
public string? ReceiptReference { get; init; }
}

View File

@ -0,0 +1,38 @@
namespace Koogle.Application.DTOs;
/// <summary>
/// Data transfer object for a cash book report.
/// </summary>
public record CashBookReportDto
{
public DateTime ReportStart { get; init; }
public DateTime ReportEnd { get; init; }
public decimal OpeningBalance { get; init; }
public decimal ClosingBalance { get; init; }
public decimal TotalIncome { get; init; }
public decimal TotalExpense { get; init; }
public List<CategorySummaryDto> IncomeByCategory { get; init; } = [];
public List<CategorySummaryDto> ExpenseByCategory { get; init; } = [];
public List<CashBookEntryDto> Entries { get; init; } = [];
}
/// <summary>
/// Summary of entries for a specific category.
/// </summary>
public record CategorySummaryDto
{
public Guid CategoryId { get; init; }
public string CategoryName { get; init; } = string.Empty;
public decimal Total { get; init; }
public int Count { get; init; }
}
/// <summary>
/// Data transfer object for creating membership fee entries.
/// </summary>
public record CreateMembershipFeesDto
{
public int Year { get; init; }
public int Month { get; init; }
public decimal? OverrideAmount { get; init; }
}