K7: add cashbook service interfaces
- IBookingCategoryService: CRUD + EnsureSystemCategories - ICashBookService: entries, balance, report, membership fees
This commit is contained in:
parent
96c5b4d196
commit
1a7ba8837d
|
|
@ -1705,7 +1705,7 @@ public enum CashBookEntryType { Income = 0, Expense = 1 }
|
||||||
| ✓ | K4 | Security | Kassenwart Role + Policy | 4 |
|
| ✓ | K4 | Security | Kassenwart Role + Policy | 4 |
|
||||||
| ✓ | K5 | Infrastructure | Repositories | 5 |
|
| ✓ | K5 | Infrastructure | Repositories | 5 |
|
||||||
| ✓ | K6 | Application | DTOs | 3 |
|
| ✓ | K6 | Application | DTOs | 3 |
|
||||||
| ☐ | K7 | Application | Service Interfaces | 2 |
|
| ✓ | K7 | Application | Service Interfaces | 2 |
|
||||||
| ☐ | K8 | Application | Service Implementations | 4 |
|
| ☐ | K8 | Application | Service Implementations | 4 |
|
||||||
| ☐ | K9 | Application | Category Seeder | 1 |
|
| ☐ | K9 | Application | Category Seeder | 1 |
|
||||||
| ☐ | K10 | Application | Day Close Integration | 1 |
|
| ☐ | K10 | Application | Day Close Integration | 1 |
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
using Koogle.Application.DTOs;
|
||||||
|
|
||||||
|
namespace Koogle.Application.Interfaces;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Service interface for managing booking category operations.
|
||||||
|
/// </summary>
|
||||||
|
public interface IBookingCategoryService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves all booking categories for the current club context.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="includeInactive">Whether to include inactive categories.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>A list of booking categories.</returns>
|
||||||
|
Task<List<BookingCategoryDto>> GetAllAsync(bool includeInactive = false, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a booking category by its unique identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The unique identifier of the category.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The category if found; otherwise, null.</returns>
|
||||||
|
Task<BookingCategoryDto?> GetByIdAsync(Guid id, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new booking category in the current club context.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto">The category creation data.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The created category.</returns>
|
||||||
|
Task<BookingCategoryDto> CreateAsync(CreateBookingCategoryDto dto, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing booking category.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto">The category update data.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The updated category.</returns>
|
||||||
|
Task<BookingCategoryDto> UpdateAsync(UpdateBookingCategoryDto dto, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a booking category (soft delete).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The unique identifier of the category to delete.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>True if deleted successfully; otherwise, false.</returns>
|
||||||
|
Task<bool> DeleteAsync(Guid id, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ensures system categories exist for the current club.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
Task EnsureSystemCategoriesAsync(CancellationToken ct = default);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
using Koogle.Application.DTOs;
|
||||||
|
|
||||||
|
namespace Koogle.Application.Interfaces;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Service interface for managing cash book operations.
|
||||||
|
/// </summary>
|
||||||
|
public interface ICashBookService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves cash book entries for the current club within optional date range.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="from">Optional start date filter.</param>
|
||||||
|
/// <param name="to">Optional end date filter.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>A list of cash book entries.</returns>
|
||||||
|
Task<List<CashBookEntryDto>> GetEntriesAsync(DateTime? from = null, DateTime? to = null, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a cash book entry by its unique identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The unique identifier of the entry.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The entry if found; otherwise, null.</returns>
|
||||||
|
Task<CashBookEntryDto?> GetByIdAsync(Guid id, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new cash book entry in the current club context.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto">The entry creation data.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The created entry.</returns>
|
||||||
|
Task<CashBookEntryDto> CreateAsync(CreateCashBookEntryDto dto, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing cash book entry.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto">The entry update data.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The updated entry.</returns>
|
||||||
|
Task<CashBookEntryDto> UpdateAsync(UpdateCashBookEntryDto dto, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a cash book entry (soft delete).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The unique identifier of the entry to delete.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>True if deleted successfully; otherwise, false.</returns>
|
||||||
|
Task<bool> DeleteAsync(Guid id, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current balance for the club.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="asOfDate">Optional date to calculate balance as of.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The current balance.</returns>
|
||||||
|
Task<decimal> GetBalanceAsync(DateTime? asOfDate = null, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Generates a cash book report for a date range.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="from">Report start date.</param>
|
||||||
|
/// <param name="to">Report end date.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The cash book report.</returns>
|
||||||
|
Task<CashBookReportDto> GetReportAsync(DateTime from, DateTime to, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves cash book entries linked to a specific day.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dayId">The day identifier.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>A list of entries for the day.</returns>
|
||||||
|
Task<List<CashBookEntryDto>> GetByDayIdAsync(Guid dayId, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates membership fee entries for all active members.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto">The membership fee creation data.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>The list of created entries.</returns>
|
||||||
|
Task<List<CashBookEntryDto>> CreateMembershipFeesAsync(CreateMembershipFeesDto dto, CancellationToken ct = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if membership fees already exist for a specific month.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="year">The year.</param>
|
||||||
|
/// <param name="month">The month.</param>
|
||||||
|
/// <param name="ct">Cancellation token.</param>
|
||||||
|
/// <returns>True if fees exist; otherwise, false.</returns>
|
||||||
|
Task<bool> MembershipFeesExistAsync(int year, int month, CancellationToken ct = default);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue