Refactor ContractType to use enum

Changed the `ContractType` property in `EnvelopeDto`, `CreateEnvelopeCommandHandler`, and `Envelope` classes from a nullable `int` to a nullable `ContractType` enum. This improves type safety and consistency across the codebase by using a specific enum type instead of a generic integer. Updated logic in `CreateEnvelopeCommandHandler` to remove unnecessary casting.
This commit is contained in:
2026-10-29 13:11:44 +01:00
parent d913b949e0
commit 7222f7e9a7
3 changed files with 4 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ public record EnvelopeDto : IEnvelope
/// <summary>
///
/// </summary>
public int? ContractType { get; set; }
public ContractType? ContractType { get; set; }
/// <summary>
/// Default value is 'de-DE'

View File

@@ -302,7 +302,7 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
ExpiresWarningWhen: expiresWarningWhenDays > 0 ? DateTime.Now.AddDays(expiresWarningWhenDays) : null,
ContractType: existing?.ContractType
?? selectedType?.ContractType
?? (int)ContractType.Contract);
?? ContractType.Contract);
}
private static string ResolveLanguage(string? preferred, string? fallback1, string? fallback2)
@@ -333,7 +333,7 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
int ExpiresWarningWhenDays,
DateTime? ExpiresWhen,
DateTime? ExpiresWarningWhen,
int ContractType);
ContractType ContractType);
private async Task<string> ResolveSenderReferenceAsync(Envelope envelope, CancellationToken cancel)
{