feat: ship agent-first mission control v0.2.57
CI - Build & Test / Backend (.NET) (push) Successful in 42s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m46s
CI - Build & Test / Security Check (push) Successful in 3s
CI - Build & Test / Deploy Nexus (push) Successful in 56s

This commit is contained in:
AzuTear
2026-07-31 22:39:47 +02:00
parent 3bc7622977
commit f5552218bc
535 changed files with 95242 additions and 8791 deletions
+29
View File
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Nexus.Api.Data;
using System.Text.Json;
namespace Nexus.Api.Repositories;
@@ -14,6 +15,7 @@ public sealed class ProjectRepository(NexusDbContext db) : IProjectRepository
public async Task<Project> AddAsync(Project project, CancellationToken ct = default)
{
db.Projects.Add(project);
db.OutboxEvents.Add(CreateProjectEvent("project.created", project));
await db.SaveChangesAsync(ct);
return project;
}
@@ -21,15 +23,42 @@ public sealed class ProjectRepository(NexusDbContext db) : IProjectRepository
public async Task UpdateAsync(Project project, CancellationToken ct = default)
{
project.UpdatedAt = DateTimeOffset.UtcNow;
db.OutboxEvents.Add(CreateProjectEvent("project.updated", project));
await db.SaveChangesAsync(ct);
}
public async Task DeleteAsync(Project project, CancellationToken ct = default)
{
db.OutboxEvents.Add(CreateProjectEvent("project.deleted", project));
db.Projects.Remove(project);
await db.SaveChangesAsync(ct);
}
public Task<bool> HasTasksAsync(Guid projectId, CancellationToken ct = default)
=> db.Tasks.AnyAsync(t => t.ProjectId == projectId, ct);
public Task<List<WorkTask>> GetTasksAsync(
Guid projectId,
CancellationToken ct = default)
=> db.Tasks
.AsNoTracking()
.Where(task => task.ProjectId == projectId)
.OrderBy(task => task.State == "Done" ? 1 : 0)
.ThenByDescending(task => task.UpdatedAt)
.ThenBy(task => task.Id)
.ToListAsync(ct);
private static OutboxEvent CreateProjectEvent(string type, Project project)
=> new()
{
Type = type,
AggregateType = "project",
AggregateId = project.Id.ToString(),
AggregateRevision = 0,
PayloadJson = JsonSerializer.Serialize(new
{
status = project.Status,
progress = project.Progress
})
};
}