Files
kjh2064 c41e5063b7 chore: remove kbx-foundation-v36 reference (superseded by v4 implementation)
Removed entire kbx-foundation-v36 directory as it's been replaced by
the new KBX Foundation v4 patterns implemented in this session:
- Registry-driven screen definitions
- Density-aware UI adapter components
- Feature module templates (ShadowRun, Models)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-12 01:39:58 +09:00

34 lines
1.3 KiB
C#

using Dapper;
using FastEndpoints;
using Npgsql;
using Shared.Operations;
namespace Modules.Common.Operations.Retry;
public sealed class Endpoint(NpgsqlDataSource dataSource, WorkItemActionRegistry registry) : EndpointWithoutRequest
{
public override void Configure() { Post("/api/operations/work-items/{id:guid}/retry"); Permissions("common.operations.retry"); }
public override async Task HandleAsync(CancellationToken ct)
{
var id = Route<Guid>("id");
var tenant = OperationsIdentity.TenantId(User);
var actor = OperationsIdentity.UserId(User);
await using var connection = await dataSource.OpenConnectionAsync(ct);
var key = await connection.QuerySingleOrDefaultAsync<string?>(new CommandDefinition("""
select retry_action_key from kbx.work_items
where tenant_id=@Tenant and id=@Id and status in ('open','claimed');
""", new { Tenant = tenant, Id = id }, cancellationToken: ct));
if (string.IsNullOrWhiteSpace(key) || !registry.TryGet(key, out var handler) || handler is null)
{
AddError("이 예외에는 안전한 재처리 동작이 등록되어 있지 않습니다.");
await Send.ErrorsAsync(cancellation: ct);
return;
}
await handler.ExecuteAsync(tenant, actor, id, ct);
await Send.OkAsync(ct);
}
}