- gRPC auth service for token validation - Value comparator system (string, numeric, boolean, datetime, collection) - Condition evaluator with strategy chain - Form definition and data improvements - Workflow instance/task endpoints updated - Seed data and EF design-time factory - Test coverage for comparators and handlers
36 lines
1011 B
C#
36 lines
1011 B
C#
using FastEndpoints;
|
|
using MediatR;
|
|
using Workflow.Application.Features.WorkflowInstances.Commands;
|
|
|
|
namespace Workflow.Api.Endpoints.WorkflowInstance;
|
|
|
|
public class WithdrawWorkflowInstanceEndpoint : Endpoint<WithdrawWorkflowInstanceRequest>
|
|
{
|
|
private readonly IMediator _mediator;
|
|
|
|
public WithdrawWorkflowInstanceEndpoint(IMediator mediator) => _mediator = mediator;
|
|
|
|
public override void Configure()
|
|
{
|
|
Post("/workflow-instances/{Id}/withdraw");
|
|
AllowAnonymous();
|
|
Summary(s =>
|
|
{
|
|
s.Summary = "Withdraw a workflow instance (initiator only)";
|
|
});
|
|
}
|
|
|
|
public override async Task HandleAsync(WithdrawWorkflowInstanceRequest req, CancellationToken ct)
|
|
{
|
|
var command = new WithdrawWorkflowInstanceCommand(req.Id, req.UserId);
|
|
await _mediator.Send(command, ct);
|
|
await Send.OkAsync(ct);
|
|
}
|
|
}
|
|
|
|
public class WithdrawWorkflowInstanceRequest
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid UserId { get; set; }
|
|
}
|