diff --git a/docs/IMPLEMENTATION_PLAN.md b/docs/IMPLEMENTATION_PLAN.md index fdce0cf..57d9418 100644 --- a/docs/IMPLEMENTATION_PLAN.md +++ b/docs/IMPLEMENTATION_PLAN.md @@ -1705,7 +1705,7 @@ public enum CashBookEntryType { Income = 0, Expense = 1 } | ✓ | K4 | Security | Kassenwart Role + Policy | 4 | | ✓ | K5 | Infrastructure | Repositories | 5 | | ✓ | K6 | Application | DTOs | 3 | -| ☐ | K7 | Application | Service Interfaces | 2 | +| ✓ | K7 | Application | Service Interfaces | 2 | | ☐ | K8 | Application | Service Implementations | 4 | | ☐ | K9 | Application | Category Seeder | 1 | | ☐ | K10 | Application | Day Close Integration | 1 | diff --git a/src/Koogle.Application/Interfaces/IBookingCategoryService.cs b/src/Koogle.Application/Interfaces/IBookingCategoryService.cs new file mode 100644 index 0000000..98396b3 --- /dev/null +++ b/src/Koogle.Application/Interfaces/IBookingCategoryService.cs @@ -0,0 +1,55 @@ +using Koogle.Application.DTOs; + +namespace Koogle.Application.Interfaces; + +/// +/// Service interface for managing booking category operations. +/// +public interface IBookingCategoryService +{ + /// + /// Retrieves all booking categories for the current club context. + /// + /// Whether to include inactive categories. + /// Cancellation token. + /// A list of booking categories. + Task> GetAllAsync(bool includeInactive = false, CancellationToken ct = default); + + /// + /// Retrieves a booking category by its unique identifier. + /// + /// The unique identifier of the category. + /// Cancellation token. + /// The category if found; otherwise, null. + Task GetByIdAsync(Guid id, CancellationToken ct = default); + + /// + /// Creates a new booking category in the current club context. + /// + /// The category creation data. + /// Cancellation token. + /// The created category. + Task CreateAsync(CreateBookingCategoryDto dto, CancellationToken ct = default); + + /// + /// Updates an existing booking category. + /// + /// The category update data. + /// Cancellation token. + /// The updated category. + Task UpdateAsync(UpdateBookingCategoryDto dto, CancellationToken ct = default); + + /// + /// Deletes a booking category (soft delete). + /// + /// The unique identifier of the category to delete. + /// Cancellation token. + /// True if deleted successfully; otherwise, false. + Task DeleteAsync(Guid id, CancellationToken ct = default); + + /// + /// Ensures system categories exist for the current club. + /// + /// Cancellation token. + Task EnsureSystemCategoriesAsync(CancellationToken ct = default); +} diff --git a/src/Koogle.Application/Interfaces/ICashBookService.cs b/src/Koogle.Application/Interfaces/ICashBookService.cs new file mode 100644 index 0000000..8dd7194 --- /dev/null +++ b/src/Koogle.Application/Interfaces/ICashBookService.cs @@ -0,0 +1,92 @@ +using Koogle.Application.DTOs; + +namespace Koogle.Application.Interfaces; + +/// +/// Service interface for managing cash book operations. +/// +public interface ICashBookService +{ + /// + /// Retrieves cash book entries for the current club within optional date range. + /// + /// Optional start date filter. + /// Optional end date filter. + /// Cancellation token. + /// A list of cash book entries. + Task> GetEntriesAsync(DateTime? from = null, DateTime? to = null, CancellationToken ct = default); + + /// + /// Retrieves a cash book entry by its unique identifier. + /// + /// The unique identifier of the entry. + /// Cancellation token. + /// The entry if found; otherwise, null. + Task GetByIdAsync(Guid id, CancellationToken ct = default); + + /// + /// Creates a new cash book entry in the current club context. + /// + /// The entry creation data. + /// Cancellation token. + /// The created entry. + Task CreateAsync(CreateCashBookEntryDto dto, CancellationToken ct = default); + + /// + /// Updates an existing cash book entry. + /// + /// The entry update data. + /// Cancellation token. + /// The updated entry. + Task UpdateAsync(UpdateCashBookEntryDto dto, CancellationToken ct = default); + + /// + /// Deletes a cash book entry (soft delete). + /// + /// The unique identifier of the entry to delete. + /// Cancellation token. + /// True if deleted successfully; otherwise, false. + Task DeleteAsync(Guid id, CancellationToken ct = default); + + /// + /// Gets the current balance for the club. + /// + /// Optional date to calculate balance as of. + /// Cancellation token. + /// The current balance. + Task GetBalanceAsync(DateTime? asOfDate = null, CancellationToken ct = default); + + /// + /// Generates a cash book report for a date range. + /// + /// Report start date. + /// Report end date. + /// Cancellation token. + /// The cash book report. + Task GetReportAsync(DateTime from, DateTime to, CancellationToken ct = default); + + /// + /// Retrieves cash book entries linked to a specific day. + /// + /// The day identifier. + /// Cancellation token. + /// A list of entries for the day. + Task> GetByDayIdAsync(Guid dayId, CancellationToken ct = default); + + /// + /// Creates membership fee entries for all active members. + /// + /// The membership fee creation data. + /// Cancellation token. + /// The list of created entries. + Task> CreateMembershipFeesAsync(CreateMembershipFeesDto dto, CancellationToken ct = default); + + /// + /// Checks if membership fees already exist for a specific month. + /// + /// The year. + /// The month. + /// Cancellation token. + /// True if fees exist; otherwise, false. + Task MembershipFeesExistAsync(int year, int month, CancellationToken ct = default); +}