| | | 1 | | using Pomodoro.Web.Models; |
| | | 2 | | |
| | | 3 | | namespace Pomodoro.Web.Services; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Composite key for activity duplicate detection |
| | | 7 | | /// </summary> |
| | | 8 | | public readonly record struct ActivityKey |
| | | 9 | | { |
| | | 10 | | public SessionType Type { get; } |
| | | 11 | | public DateTime CompletedAt { get; } |
| | | 12 | | public int DurationMinutes { get; } |
| | | 13 | | public string? TaskName { get; } |
| | | 14 | | |
| | | 15 | | public ActivityKey(SessionType type, DateTime completedAt, int durationMinutes, string? taskName) |
| | | 16 | | { |
| | | 17 | | Type = type; |
| | | 18 | | CompletedAt = completedAt; |
| | | 19 | | DurationMinutes = durationMinutes; |
| | | 20 | | TaskName = taskName; |
| | | 21 | | } |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Composite key for task duplicate detection |
| | | 26 | | /// </summary> |
| | | 27 | | public readonly record struct TaskKey |
| | | 28 | | { |
| | 2 | 29 | | public string Name { get; } |
| | 2 | 30 | | public DateTime CreatedAt { get; } |
| | | 31 | | |
| | | 32 | | public TaskKey(string name, DateTime createdAt) |
| | 34 | 33 | | { |
| | 34 | 34 | | Name = name; |
| | 34 | 35 | | CreatedAt = createdAt; |
| | 34 | 36 | | } |
| | | 37 | | } |