Initial commit: Add project files
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using FastEndpoints;
|
||||
using KArtSell.Modules.ModelOperations.FeedbackLoop;
|
||||
|
||||
namespace KArtSell.Modules.ModelOperations.Features.GetModelFeedbackLoop;
|
||||
|
||||
public sealed class Endpoint : EndpointWithoutRequest<Response>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/model-operations/feedback-loop");
|
||||
Roles("Quant", "Risk", "Compliance", "Operations", "Administrator");
|
||||
Summary(x =>
|
||||
{
|
||||
x.Summary = "Returns the governed continuous model feedback plan.";
|
||||
x.Description = "This endpoint exposes evaluation/proposal stages only. It cannot activate a model or submit an order.";
|
||||
});
|
||||
}
|
||||
|
||||
public override Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
var stages = ModelFeedbackPlan.Stages.Select(x => new ModelFeedbackStageResponse(
|
||||
x.Order, x.StageCode, x.OperationCode, x.Name, x.AutomationBoundary,
|
||||
x.RequiredEvidence, x.HumanDecision, x.FailureAction)).ToArray();
|
||||
return Send.OkAsync(new Response(ModelFeedbackPlan.Boundary, stages), ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace KArtSell.Modules.ModelOperations.Features.GetModelFeedbackLoop;
|
||||
|
||||
public sealed record ModelFeedbackStageResponse(
|
||||
int Order,
|
||||
string StageCode,
|
||||
string OperationCode,
|
||||
string Name,
|
||||
string AutomationBoundary,
|
||||
string RequiredEvidence,
|
||||
string HumanDecision,
|
||||
string FailureAction);
|
||||
|
||||
public sealed record Response(string Boundary, IReadOnlyList<ModelFeedbackStageResponse> Stages);
|
||||
@@ -0,0 +1,35 @@
|
||||
using FastEndpoints;
|
||||
using KArtSell.Modules.ModelOperations.Domain;
|
||||
|
||||
namespace KArtSell.Modules.ModelOperations.Features.GetModelOperationsPlan;
|
||||
|
||||
public sealed class Endpoint : EndpointWithoutRequest<Response>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/internal/v1/model-operations/plan");
|
||||
Roles("Quant", "Risk", "System", "Auditor");
|
||||
Description(x => x.WithTags("ModelOperations"));
|
||||
}
|
||||
|
||||
public override Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
var items = ModelOperationRegistry.All.Select(x => new OperationItem(
|
||||
x.OperationCode,
|
||||
x.Name,
|
||||
x.Cadence.ToContractValue(),
|
||||
x.AutomationMode.ToContractValue(),
|
||||
x.Queue,
|
||||
x.PrimaryOwner,
|
||||
x.SecondaryOwner,
|
||||
x.RequiredEvidence,
|
||||
x.Output,
|
||||
x.Gate)).ToArray();
|
||||
|
||||
return Send.OkAsync(new Response(
|
||||
"RESEARCH_CANDIDATE_NOT_PRODUCTION",
|
||||
"AUTOMATIC_ORDER_AND_KIS_SUBMISSION_OFF",
|
||||
"EVALUATION_AND_PROPOSAL_ONLY_HUMAN_APPROVAL_REQUIRED",
|
||||
items), ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace KArtSell.Modules.ModelOperations.Features.GetModelOperationsPlan;
|
||||
|
||||
public sealed record OperationItem(
|
||||
string OperationCode,
|
||||
string Name,
|
||||
string Cadence,
|
||||
string AutomationMode,
|
||||
string Queue,
|
||||
string PrimaryOwner,
|
||||
string SecondaryOwner,
|
||||
string RequiredEvidence,
|
||||
string Output,
|
||||
string Gate);
|
||||
|
||||
public sealed record Response(
|
||||
string AlgorithmStatus,
|
||||
string OrderCapability,
|
||||
string ModelMutationBoundary,
|
||||
IReadOnlyList<OperationItem> Operations);
|
||||
Reference in New Issue
Block a user