Refactor entities: remove preprocessor directives, unify style

Large-scale cleanup of entity and interface classes:
- Removed obsolete #if NET/NETFRAMEWORK preprocessor blocks
- Unified class/property formatting and indentation
- Standardized use of data annotations
- Improved nullable reference type handling
- Simplified interfaces (IHasEnvelope, IHasReceiver)
- Removed redundant and dead code
- No changes to business logic or data model

These changes modernize and standardize the codebase for easier maintenance and .NET compatibility.
This commit is contained in:
2026-02-09 15:32:41 +01:00
parent e2afbc5a62
commit 910a870ddf
9 changed files with 321 additions and 409 deletions

View File

@@ -4,69 +4,58 @@ using System.ComponentModel.DataAnnotations.Schema;
using DigitalData.Core.Abstractions.Interfaces;
using EnvelopeGenerator.Domain.Interfaces;
#if NETFRAMEWORK
#endif
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
#endif
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
{
public DocumentStatus()
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
{
// TODO: * check Form Application and remove default value
public DocumentStatus()
{
// TODO: * check Form Application and remove default value
#if NETFRAMEWORK
Status = Constants.DocumentStatus.Created;
Status = Constants.DocumentStatus.Created;
#endif
}
}
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("GUID")]
public int Id { get; set; }
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("GUID")]
public int Id { get; set; }
[Required]
[Column("ENVELOPE_ID")]
public int EnvelopeId { get; set; }
[Required]
[Column("ENVELOPE_ID")]
public int EnvelopeId { get; set; }
[Required]
[Column("RECEIVER_ID")]
public int ReceiverId { get; set; }
[Required]
[Column("RECEIVER_ID")]
public int ReceiverId { get; set; }
[Required]
[Column("STATUS")]
public Constants.DocumentStatus Status { get; set; }
[Required]
[Column("STATUS")]
public Constants.DocumentStatus Status { get; set; }
[Required]
[Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; }
[Required]
[Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; }
[Column("CHANGED_WHEN", TypeName = "datetime")]
public DateTime? ChangedWhen { get; set; }
[Column("VALUE", TypeName = "nvarchar(max)")]
public string Value { get; set; }
[Column("VALUE", TypeName = "nvarchar(max)")]
public string Value { get; set; }
[ForeignKey("EnvelopeId")]
public virtual Envelope
#if NET
?
[ForeignKey("EnvelopeId")]
public virtual Envelope
#if nullable
?
#endif
Envelope { get; set; }
Envelope { get; set; }
[ForeignKey("ReceiverId")]
public virtual Receiver
#if NET
?
[ForeignKey("ReceiverId")]
public virtual Receiver
#if nullable
?
#endif
Receiver { get; set; }
}
#if NETFRAMEWORK
}
#endif
}