Refactor controllers and update envelope status handling

- Updated `TestEnvelopeHistoryController` to use `EnvelopeStatus` for status parameters and marked it as obsolete.
- Modified `TestViewController` with new route attributes, simplified constructor, and improved error handling in HTTP methods.
- Cleaned up `DebugEnvelopes.cshtml` by removing unnecessary using directives and ensuring type safety in envelope grouping.
This commit is contained in:
2025-06-27 13:51:51 +02:00
parent fcbe956095
commit 6f73ba929c
3 changed files with 49 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
@using EnvelopeGenerator.CommonServices;
@using EnvelopeGenerator.Domain;
@using EnvelopeGenerator.Domain.Entities;
@using static EnvelopeGenerator.Domain.Constants;
@{
ViewData["Title"] = "Debug";
@@ -12,9 +12,9 @@
return Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, receiver.Signature);
}
IEnumerable<IGrouping<EnvelopeStatus, Envelope>> groupEnvelopes(List<Envelope> envelopes)
IEnumerable<IGrouping<EnvelopeStatus, Envelope>> groupEnvelopes(List<Envelope> envelopes)
{
return envelopes.GroupBy(item => item.Status).OrderBy(item => (int)item.Key);
return envelopes.GroupBy(item => (EnvelopeStatus) item.Status).OrderBy(item => item.Key);
}
}