Frontend gaps fill work. Testing fixes work. Auditing in progress.
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
namespace StellaOps.Notifier.WebService.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// API contracts for delivery history and retry endpoints.
|
||||
/// Sprint: SPRINT_20251229_018b_FE_notification_delivery_audit
|
||||
/// Task: NOTIFY-016
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// Response for delivery listing.
|
||||
/// </summary>
|
||||
public sealed record DeliveryListResponse
|
||||
{
|
||||
public required IReadOnlyList<DeliveryResponse> Items { get; init; }
|
||||
public required int Total { get; init; }
|
||||
public string? ContinuationToken { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Individual delivery response.
|
||||
/// </summary>
|
||||
public sealed record DeliveryResponse
|
||||
{
|
||||
public required string DeliveryId { get; init; }
|
||||
public required string TenantId { get; init; }
|
||||
public required string RuleId { get; init; }
|
||||
public required string ChannelId { get; init; }
|
||||
public string? EventId { get; init; }
|
||||
public string? EventKind { get; init; }
|
||||
public string? Target { get; init; }
|
||||
public required string Status { get; init; }
|
||||
public required IReadOnlyList<DeliveryAttemptResponse> Attempts { get; init; }
|
||||
public required int RetryCount { get; init; }
|
||||
public string? NextRetryAt { get; init; }
|
||||
public string? Subject { get; init; }
|
||||
public string? ErrorMessage { get; init; }
|
||||
public required string CreatedAt { get; init; }
|
||||
public string? SentAt { get; init; }
|
||||
public string? CompletedAt { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Individual delivery attempt response.
|
||||
/// </summary>
|
||||
public sealed record DeliveryAttemptResponse
|
||||
{
|
||||
public required int AttemptNumber { get; init; }
|
||||
public required string Timestamp { get; init; }
|
||||
public required string Status { get; init; }
|
||||
public int? StatusCode { get; init; }
|
||||
public string? ErrorMessage { get; init; }
|
||||
public int? ResponseTimeMs { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request to retry a failed delivery.
|
||||
/// </summary>
|
||||
public sealed record DeliveryRetryRequest
|
||||
{
|
||||
public string? ForceChannel { get; init; }
|
||||
public bool BypassThrottle { get; init; }
|
||||
public string? Reason { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Response from retry operation.
|
||||
/// </summary>
|
||||
public sealed record DeliveryRetryResponse
|
||||
{
|
||||
public required string DeliveryId { get; init; }
|
||||
public required bool Retried { get; init; }
|
||||
public required int NewAttemptNumber { get; init; }
|
||||
public required string ScheduledAt { get; init; }
|
||||
public string? Message { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delivery statistics response.
|
||||
/// </summary>
|
||||
public sealed record DeliveryStatsResponse
|
||||
{
|
||||
public required int TotalSent { get; init; }
|
||||
public required int TotalFailed { get; init; }
|
||||
public required int TotalThrottled { get; init; }
|
||||
public required int TotalPending { get; init; }
|
||||
public required double AvgDeliveryTimeMs { get; init; }
|
||||
public required double SuccessRate { get; init; }
|
||||
public required string Period { get; init; }
|
||||
public required IReadOnlyDictionary<string, ChannelStatsResponse> ByChannel { get; init; }
|
||||
public required IReadOnlyDictionary<string, EventKindStatsResponse> ByEventKind { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statistics by channel.
|
||||
/// </summary>
|
||||
public sealed record ChannelStatsResponse
|
||||
{
|
||||
public required int Sent { get; init; }
|
||||
public required int Failed { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statistics by event kind.
|
||||
/// </summary>
|
||||
public sealed record EventKindStatsResponse
|
||||
{
|
||||
public required int Sent { get; init; }
|
||||
public required int Failed { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user