Refactor enum usage in codebase

Updated references from `Constants` to direct usage of `EnvelopeStatus` and `EmailTemplateType` enums. This change enhances code readability and reduces dependency on the `Constants` class.

Modified properties and parameters across command classes, DTOs, repositories, and services to use the enums directly. Updated `ModifyDocStatusCommandBase`, `EnvelopeHistoryDto`, and `ResetEmailTemplateCommand` for improved clarity.

Consistent updates across multiple files indicate a systematic refactoring aimed at streamlining the codebase and improving maintainability. Comments and documentation have also been revised to reflect these changes.
This commit is contained in:
2025-09-01 11:04:40 +02:00
parent fc4187bb9e
commit c5c040fb15
38 changed files with 245 additions and 218 deletions

View File

@@ -30,7 +30,7 @@ public class HistoryTests
{
EnvelopeId = 1,
UserReference = "UserA",
Status = Constants.EnvelopeStatus.EnvelopeCreated,
Status = EnvelopeStatus.EnvelopeCreated,
Comment = "First create"
};
@@ -55,26 +55,26 @@ public class HistoryTests
{
EnvelopeId = 2,
UserReference = "UserX",
Status = Constants.EnvelopeStatus.EnvelopeCreated
Status = EnvelopeStatus.EnvelopeCreated
};
var createCmd2 = new CreateHistoryCommand
{
EnvelopeId = 2,
UserReference = "UserX",
Status = Constants.EnvelopeStatus.EnvelopePartlySigned
Status = EnvelopeStatus.EnvelopePartlySigned
};
await _host.Mediator.Send(createCmd1);
await _host.Mediator.Send(createCmd2);
// Act
var result = await _host.Mediator.Send(new ReadHistoryQuery(2, Constants.EnvelopeStatus.EnvelopePartlySigned));
var result = await _host.Mediator.Send(new ReadHistoryQuery(2, EnvelopeStatus.EnvelopePartlySigned));
// Assert
Assert.That(result, Has.Exactly(1).Items);
Assert.That(result, Has.All.Matches<EnvelopeGenerator.Application.Dto.EnvelopeHistory.EnvelopeHistoryDto>(
r => r.Status == Constants.EnvelopeStatus.EnvelopePartlySigned));
r => r.Status == EnvelopeStatus.EnvelopePartlySigned));
}
[Test]