40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using MediatR;
|
|
using MyService.Domain.AggregatesModel.SampleAggregate;
|
|
|
|
namespace MyService.Domain.Events;
|
|
|
|
/// <summary>
|
|
/// EN: Domain event raised when Sample status changes.
|
|
/// VI: Domain event được phát ra khi trạng thái Sample thay đổi.
|
|
/// </summary>
|
|
public class SampleStatusChangedDomainEvent : INotification
|
|
{
|
|
/// <summary>
|
|
/// EN: The sample ID.
|
|
/// VI: ID của sample.
|
|
/// </summary>
|
|
public Guid SampleId { get; }
|
|
|
|
/// <summary>
|
|
/// EN: Previous status before the change.
|
|
/// VI: Trạng thái trước khi thay đổi.
|
|
/// </summary>
|
|
public SampleStatus PreviousStatus { get; }
|
|
|
|
/// <summary>
|
|
/// EN: New status after the change.
|
|
/// VI: Trạng thái mới sau khi thay đổi.
|
|
/// </summary>
|
|
public SampleStatus NewStatus { get; }
|
|
|
|
public SampleStatusChangedDomainEvent(
|
|
Guid sampleId,
|
|
SampleStatus previousStatus,
|
|
SampleStatus newStatus)
|
|
{
|
|
SampleId = sampleId;
|
|
PreviousStatus = previousStatus;
|
|
NewStatus = newStatus;
|
|
}
|
|
}
|