Initial commit: Add project files
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
namespace __MODULE__;
|
||||
|
||||
public static class Module
|
||||
{
|
||||
public static IServiceCollection Add__MODULE__(this IServiceCollection services)
|
||||
{
|
||||
// Register only module-owned policies, application handlers, and adapters.
|
||||
return services;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FastEndpoints;
|
||||
|
||||
namespace __MODULE__.Features.__SLICE__;
|
||||
|
||||
public sealed class Endpoint(Handler handler) : Endpoint<Request, Response>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
__HTTP_METHOD__("/__ROUTE__");
|
||||
Roles("__ROLE__");
|
||||
Description(x => x.WithTags("__MODULE__"));
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(Request req, CancellationToken ct)
|
||||
{
|
||||
var result = await handler.HandleAsync(req, HttpContext.TraceIdentifier, ct);
|
||||
await Send.OkAsync(result, ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace __MODULE__.Features.__SLICE__;
|
||||
|
||||
public sealed class Handler(/* narrow ports only */)
|
||||
{
|
||||
public async Task<Response> HandleAsync(Request request, string correlationId, CancellationToken ct)
|
||||
{
|
||||
// 1) server-side PIT context 2) idempotency 3) transaction 4) policy 5) outbox
|
||||
throw new NotImplementedException("Complete the approved Slice Spec; do not guess missing contracts.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace __MODULE__.Domain;
|
||||
|
||||
public sealed class __POLICY__
|
||||
{
|
||||
public Decision Evaluate(ApprovedPointInTimeInput input)
|
||||
{
|
||||
// Pure decision only. No Dapper, HTTP, Hangfire, DateTime.Now, or mutable global state.
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# __SLICE__
|
||||
|
||||
- Requirement: __REQUIREMENT_ID__
|
||||
- Module: __MODULE__
|
||||
- Route: `__HTTP_METHOD__ /__ROUTE__`
|
||||
- Role: `__ROLE__`
|
||||
- Generated status: SCAFFOLD_ONLY / DECISION_REQUIRED contracts remain blocked.
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace __MODULE__.Features.__SLICE__;
|
||||
|
||||
public sealed record Request(/* approved request fields only */);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace __MODULE__.Features.__SLICE__;
|
||||
|
||||
public sealed record Response(/* approved response fields only */);
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace __MODULE__.Features.__SLICE__;
|
||||
|
||||
internal static class Sql
|
||||
{
|
||||
internal const string ReadApprovedContext = """
|
||||
-- SCAFFOLD_ONLY: replace only after schema ownership, explicit columns,
|
||||
-- PIT cutoff, quality gate and key contract are approved in the Slice Spec.
|
||||
select 1 as contract_not_ready
|
||||
where false;
|
||||
""";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
public sealed class __SLICE__Tests
|
||||
{
|
||||
[Fact]
|
||||
public void Golden_case_is_reproducible() { }
|
||||
|
||||
[Fact]
|
||||
public void Boundary_and_forbidden_transition_fail_closed() { }
|
||||
|
||||
[Fact]
|
||||
public void Same_idempotency_key_has_one_side_effect() { }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using FastEndpoints;
|
||||
using FluentValidation;
|
||||
|
||||
namespace __MODULE__.Features.__SLICE__;
|
||||
|
||||
public sealed class Validator : Validator<Request>
|
||||
{
|
||||
public Validator()
|
||||
{
|
||||
// Translate approved boundary rules only; UNKNOWN and DECISION_REQUIRED must fail closed.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user