37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System;
|
|
using Svrnty.CQRS.Events.Abstractions.Models;
|
|
using Svrnty.CQRS.Events.Abstractions.Schema;
|
|
using Svrnty.CQRS.Events.Abstractions.EventStore;
|
|
using Svrnty.CQRS.Events.Abstractions;
|
|
|
|
namespace Svrnty.Sample.Events;
|
|
|
|
/// <summary>
|
|
/// Base class for all user-related events.
|
|
/// Inherits auto-managed framework properties (EventId, CorrelationId, OccurredAt) from CorrelatedEvent.
|
|
/// Used to strongly-type event emissions from user commands.
|
|
/// </summary>
|
|
public abstract record UserEvent : CorrelatedEvent
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event emitted when a user is added.
|
|
/// Framework automatically manages EventId, CorrelationId, and OccurredAt.
|
|
/// </summary>
|
|
public sealed record UserAddedEvent : UserEvent
|
|
{
|
|
public required int UserId { get; init; }
|
|
public required string Name { get; init; }
|
|
public required string Email { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event emitted when a user is removed.
|
|
/// Framework automatically manages EventId, CorrelationId, and OccurredAt.
|
|
/// </summary>
|
|
public sealed record UserRemovedEvent : UserEvent
|
|
{
|
|
public required int UserId { get; init; }
|
|
}
|