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,41 @@
using Microsoft.AspNetCore.Mvc;
using TaskTracker.Core.DTOs;
using TaskTracker.Core.Entities;
using TaskTracker.Core.Interfaces;
namespace TaskTracker.Api.Controllers;
[ApiController]
[Route("api/tasks/{taskId:int}/notes")]
public class NotesController(ITaskRepository taskRepo) : ControllerBase
{
[HttpGet]
public async Task<IActionResult> GetNotes(int taskId)
{
var task = await taskRepo.GetByIdAsync(taskId);
if (task is null)
return NotFound(ApiResponse.Fail("Task not found"));
return Ok(ApiResponse<List<TaskNote>>.Ok(task.Notes));
}
[HttpPost]
public async Task<IActionResult> AddNote(int taskId, [FromBody] CreateNoteRequest request)
{
var task = await taskRepo.GetByIdAsync(taskId);
if (task is null)
return NotFound(ApiResponse.Fail("Task not found"));
var note = new TaskNote
{
Content = request.Content,
Type = request.Type,
CreatedAt = DateTime.UtcNow
};
task.Notes.Add(note);
await taskRepo.UpdateAsync(task);
return Ok(ApiResponse<TaskNote>.Ok(note));
}
}