using Koogle.Application.DTOs; using Koogle.Domain.Enums; namespace Koogle.Application.Interfaces; /// /// Service interface for managing triggers and firing automatic expense assignments. /// public interface ITriggerService { /// /// Gets all available trigger types with their associated expenses for the current club. /// /// Cancellation token. /// A list of trigger DTOs with their linked expenses. Task> GetAllTriggersAsync(CancellationToken ct = default); /// /// Gets all expenses linked to a specific trigger type for the current club. /// /// The expense trigger type. /// Cancellation token. /// A list of expenses linked to the trigger type. Task> GetExpensesForTriggerAsync(ExpenseTriggerType type, CancellationToken ct = default); /// /// Checks if a trigger type has any linked expenses for the current club. /// /// The expense trigger type. /// Cancellation token. /// True if the trigger has linked expenses; otherwise, false. Task HasExpensesForTriggerAsync(ExpenseTriggerType type, CancellationToken ct = default); /// /// Fires a trigger, creating PersonExpenses for all linked expenses. /// /// The trigger type (e.g., ExpensePoint, Circle, NinePins). /// The person receiving the expense(s). /// The day context for the expense. /// Optional game context for the expense. /// Multiplier for expense price (e.g., remaining points in Scheiss-Spiel). Default is 1. /// Cancellation token. /// A list of created PersonExpense DTOs. Task> FireTriggerAsync( ExpenseTriggerType type, Guid personId, Guid dayId, Guid? gameId = null, int multiplier = 1, CancellationToken ct = default); /// /// Links an expense to a trigger for the current club. /// /// The expense to link. /// The trigger to link to. /// Cancellation token. Task LinkExpenseToTriggerAsync(Guid expenseId, Guid triggerId, CancellationToken ct = default); /// /// Unlinks an expense from a trigger for the current club. /// /// The expense to unlink. /// The trigger to unlink from. /// Cancellation token. /// True if unlinked successfully; otherwise, false. Task UnlinkExpenseFromTriggerAsync(Guid expenseId, Guid triggerId, CancellationToken ct = default); }