add attendance
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using ROLAC.API.DTOs.MealAttendance;
|
||||
|
||||
namespace ROLAC.API.Services;
|
||||
|
||||
public interface IMealAttendanceService
|
||||
{
|
||||
/// <summary>Today's date in the server's local time zone (the church's "current Sunday").</summary>
|
||||
DateOnly Today { get; }
|
||||
|
||||
/// <summary>Returns the counts for <paramref name="date"/>, creating a zeroed row if none exists.</summary>
|
||||
Task<AttendanceCountsDto> GetOrCreateAsync(DateOnly date);
|
||||
|
||||
/// <summary>
|
||||
/// Atomically adds <paramref name="delta"/> (may be negative) to one age-group column,
|
||||
/// clamped at zero, and returns the resulting authoritative counts.
|
||||
/// </summary>
|
||||
Task<AttendanceCountsDto> IncrementAsync(DateOnly date, string category, int delta);
|
||||
|
||||
/// <summary>
|
||||
/// Sets one age-group column to an absolute <paramref name="value"/> (clamped at zero),
|
||||
/// overwriting the current count, and returns the resulting authoritative counts.
|
||||
/// </summary>
|
||||
Task<AttendanceCountsDto> SetAsync(DateOnly date, string category, int value);
|
||||
|
||||
/// <summary>Returns the daily counts within the inclusive date range, ordered by date (for the dashboard).</summary>
|
||||
Task<IReadOnlyList<AttendanceCountsDto>> GetRangeAsync(DateOnly from, DateOnly to);
|
||||
}
|
||||
Reference in New Issue
Block a user