feat(backend): add problem/need submission module with workflow and events
Add submission CRUD with pagination and role scoping, challenge/location binding, automatic keyword extraction, a validated status workflow, and domain events for matchmaking and notifications. Create a problem record together with each submission.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TarninaHub.Application.Abstractions;
|
||||
|
||||
namespace TarninaHub.Infrastructure.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Placeholder publisher: logs domain events. Will be replaced/wired to
|
||||
/// matchmaking (steps 14-15) and notifications (step 17).
|
||||
/// </summary>
|
||||
public sealed class LoggingSubmissionEventPublisher : ISubmissionEventPublisher
|
||||
{
|
||||
private readonly ILogger<LoggingSubmissionEventPublisher> _logger;
|
||||
|
||||
public LoggingSubmissionEventPublisher(ILogger<LoggingSubmissionEventPublisher> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Task PublishAsync(SubmissionEvent submissionEvent, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation(
|
||||
"Domain event {EventType} for {SubmissionId} (status: {Status}, actor: {ActorId})",
|
||||
submissionEvent.Type,
|
||||
submissionEvent.SubmissionId,
|
||||
submissionEvent.Status,
|
||||
submissionEvent.ActorId ?? "system");
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user