Initial commit: Add project files
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using FastEndpoints;
|
||||
namespace KArtSell.Modules.__MODULE__.Features.__FEATURE__;
|
||||
public sealed class Endpoint(IHandler handler) : Endpoint<Request, Response>
|
||||
{
|
||||
public override void Configure() { Post("/api/v1/__MODULE__/__FEATURE__"); Policies("__SLICE_ID__"); }
|
||||
public override async Task HandleAsync(Request request, CancellationToken ct)
|
||||
=> await SendOkAsync(await handler.HandleAsync(request, ct), ct);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace KArtSell.Modules.__MODULE__.Features.__FEATURE__;
|
||||
public interface IHandler { Task<Response> HandleAsync(Request request, CancellationToken ct); }
|
||||
public sealed class Handler : IHandler
|
||||
{
|
||||
public Task<Response> HandleAsync(Request request, CancellationToken ct)
|
||||
=> throw new NotImplementedException("Load approved server-side PIT context, execute a pure policy, persist decision and Outbox in one transaction.");
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
# __SLICE_ID__ __MODULE__.__FEATURE__
|
||||
Required before implementation: Requirement/Policy/Data/API/DB/Job/UI/Test IDs, PIT cutoff, state transition, idempotency key, transaction boundary, Outbox event, Golden/boundary/failure/replay tests, metric/alert/runbook/rollback.
|
||||
@@ -0,0 +1,2 @@
|
||||
namespace KArtSell.Modules.__MODULE__.Features.__FEATURE__;
|
||||
public sealed record Request(string IdempotencyKey, string ScopeId, DateTimeOffset AsOf);
|
||||
@@ -0,0 +1,2 @@
|
||||
namespace KArtSell.Modules.__MODULE__.Features.__FEATURE__;
|
||||
public sealed record Response(Guid Id, string Status, string EvidenceHash, DateTimeOffset AsOf);
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace KArtSell.Modules.__MODULE__.Features.__FEATURE__;
|
||||
internal static class Sql
|
||||
{
|
||||
public const string LoadContext = """select /* explicit columns */ 1 where @as_of is not null;""";
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using FluentValidation;
|
||||
namespace KArtSell.Modules.__MODULE__.Features.__FEATURE__;
|
||||
public sealed class Validator : AbstractValidator<Request>
|
||||
{
|
||||
public Validator() { RuleFor(x => x.IdempotencyKey).NotEmpty().MaximumLength(100); RuleFor(x => x.ScopeId).NotEmpty(); RuleFor(x => x.AsOf).NotEmpty(); }
|
||||
}
|
||||
Reference in New Issue
Block a user