Refactor EnvelopeStatus usage and streamline code

- Added `EnvelopeGenerator.Domain.Constants` in multiple files, replacing `Domain.Constants.EnvelopeStatus` with `EnvelopeStatus` for improved readability.
- Modified `CreateEnvelopeCommandHandler.cs` to directly use `request.UserId`, eliminating unnecessary local variable assignment.
- Identified potential duplication in query logic within `ReceiverAlreadySignedQuery.cs`.
- Updated `IEnvelopeService`, `EnvelopeReceiverService`, and `EnvelopeService` to ensure consistent usage of the simplified `EnvelopeStatus`.
- Overall, these changes enhance code maintainability and clarity.
This commit is contained in:
2025-09-01 11:11:30 +02:00
parent ef7e694c9f
commit 48ce0d5f32
9 changed files with 20 additions and 21 deletions

View File

@@ -10,11 +10,9 @@ using Microsoft.Extensions.Logging;
using EnvelopeGenerator.Application.Extensions;
using EnvelopeGenerator.Application.Dto.Messaging;
using EnvelopeGenerator.Application.Interfaces.Services;
using EnvelopeGenerator.Application.Envelopes;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Application.Receivers.Queries;
using System.Reflection.Metadata;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Services;
@@ -249,7 +247,7 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
if (envelopeQuery?.Uuid is string uuid)
er_list = er_list.Where(er => er.Envelope?.Uuid == uuid);
if (envelopeQuery?.Status?.Include?.FirstOrDefault() is Domain.Constants.EnvelopeStatus status)
if (envelopeQuery?.Status?.Include?.FirstOrDefault() is EnvelopeStatus status)
er_list = er_list.Where(er => er.Envelope?.Status == status);
if(receiverQuery?.Id is int id)