Refactor: Replace EnvelopeTypeId with EnvelopeType enum
Replaced all instances of `EnvelopeTypeId` (int/int?) with `Type` (EnvelopeType/EnvelopeType?) across the codebase to improve type safety and readability. Updated affected properties, methods, and logic in DTOs, commands, handlers, and Razor components. Introduced conditional compilation to handle differences between .NET and .NET Framework where necessary. Removed obsolete helper methods for `EnvelopeTypeId`. This refactor ensures consistent use of the strongly-typed `EnvelopeType` enum, reducing the risk of invalid values and aligning with best practices.
This commit is contained in:
@@ -31,7 +31,7 @@ namespace EnvelopeGenerator.Domain.Constants
|
||||
$"Invalid EnvelopeTypeId '{envelopeTypeId}' for envelope. " +
|
||||
$"Valid {nameof(EnvelopeType)} values are: [{validValues}]. " +
|
||||
"This indicates a data integrity issue: the envelope may have been " +
|
||||
"created or updated with an invalid EnvelopeTypeId in the database.");
|
||||
"created or updated with an invalid EnvelopeType in the database.");
|
||||
}
|
||||
|
||||
return (EnvelopeType)Enum.ToObject(typeof(EnvelopeType), envelopeTypeId);
|
||||
|
||||
Reference in New Issue
Block a user