chore: initial commit of TaskTracker project

Existing ASP.NET API with vanilla JS SPA, WindowWatcher, Chrome extension, and MCP server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 22:08:45 -05:00
commit e12f78c479
66 changed files with 5170 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using Microsoft.EntityFrameworkCore;
using TaskTracker.Core.Entities;
using TaskTracker.Core.Interfaces;
using TaskTracker.Infrastructure.Data;
namespace TaskTracker.Infrastructure.Repositories;
public class ContextEventRepository(TaskTrackerDbContext db) : IContextEventRepository
{
public async Task<ContextEvent> CreateAsync(ContextEvent contextEvent)
{
contextEvent.Timestamp = DateTime.UtcNow;
db.ContextEvents.Add(contextEvent);
await db.SaveChangesAsync();
return contextEvent;
}
public async Task<List<ContextEvent>> GetRecentAsync(int minutes = 30)
{
var since = DateTime.UtcNow.AddMinutes(-minutes);
return await db.ContextEvents
.Where(c => c.Timestamp >= since)
.OrderByDescending(c => c.Timestamp)
.ToListAsync();
}
public async Task<List<ContextEvent>> GetByTaskIdAsync(int taskId)
{
return await db.ContextEvents
.Where(c => c.WorkTaskId == taskId)
.OrderByDescending(c => c.Timestamp)
.ToListAsync();
}
}