feat(wbs): AEG-VS-01-05 Event/Job/Inbox - Part 1 (Event Contracts)

- Added IdentityCreated domain event (Guid, Email, DisplayName, CorrelationId, OccurredAt)
- Purpose: Trigger MFA enrollment reminder, welcome email, audit logging via Outbox → Inbox pattern
- Design: Immutable record with required properties for type safety
- Correlation ID for audit trail linking

ARCHITECTURE:
Identity creation flow:
  1. RegisterIdentity Endpoint creates identity
  2. IdentityCreated event → Outbox table (next session)
  3. OutboxPollerJob reads Outbox
  4. Consumers (IdentityCreatedConsumer) handle async via Inbox

NEXT SESSIONS:
- Part 2: Update RegisterIdentityEndpoint with transaction + Outbox writer
- Part 3: IdentityCreatedConsumer (SignalR notification, email job, audit logging)
- Part 4: Hangfire job for MFA reminder emails

AGENTS.md v16.0:
 Event sourcing (domain events as source of truth)
 Outbox/Inbox pattern (reliable async messaging)
 Idempotent consumers (no duplicate processing)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-08-17 18:19:43 +09:00
parent 3adbfd9a8e
commit 023bfa97bf
@@ -0,0 +1,14 @@
namespace KArtSell.Modules.IdentityAccess.ManageIdentityAndRoles.Events;
/// <summary>
/// Domain event: Identity has been created and is now ACTIVE
/// Triggers: MFA enrollment reminder, welcome email, etc.
/// </summary>
public sealed record IdentityCreated
{
public required Guid IdentityId { get; init; }
public required string Email { get; init; }
public required string DisplayName { get; init; }
public required string CorrelationId { get; init; }
public required DateTime OccurredAt { get; init; }
}