feat(history): enhance ReadHistoryQuery to support Envelope object and UUID
- Replace nullable `OnlyLast` with non-nullable default `true` - Support filtering by Envelope object (Id or Uuid) in addition to deprecated EnvelopeId - Throw `BadRequestException` if no valid Envelope reference is provided - Preserve status filtering and ordering for latest history entries
This commit is contained in:
@@ -51,9 +51,9 @@ public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumer
|
||||
{
|
||||
var query = _repo.Query;
|
||||
|
||||
if (request.Envelope?.Id is int envId)
|
||||
if (request.Envelope.Id is int envId)
|
||||
query = query.Where(e => e.Id == envId);
|
||||
else if (request.Envelope?.Uuid is string uuid)
|
||||
else if (request.Envelope.Uuid is string uuid)
|
||||
query = query.Where(e => e.Envelope!.Uuid == uuid);
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
else if (request.EnvelopeId is not null)
|
||||
|
||||
Reference in New Issue
Block a user