Code refactor finished

This commit is contained in:
Michał Zieliski
2024-06-18 22:02:19 +02:00
parent 7e8406dc9b
commit 763b4a8c4d
19 changed files with 1105 additions and 1228 deletions

View File

@@ -1,44 +1,42 @@
using System.ComponentModel.DataAnnotations;
namespace WebAPI.Models
namespace WebAPI.Models;
public enum LayerType
{
public enum LayerType
{
import,
processed,
administration,
}
public class Layer
{
#region Properties
[Key]
public Guid Id { get; set; }
[Required]
public int Number { get; set; }
[Required]
public string? Source { get; set; }
[Required]
public string? Name { get; set; }
[Required]
public LayerType Type { get; set; }
[Required]
public DateTime CreatedAt { get; set; }
[Required]
public DateTime ModifiedAt { get; set; }
[Required]
public bool IsDeleted { get; set; }
#endregion
#region Relations
public ICollection<Record>? Records { get; set; }
public ICollection<ProcessSource>? Sources { get; set; }
[Required]
public Guid CreatedById { get; set; }
public User? CreatedBy { get; set; }
[Required]
public Guid ModifiedById { get; set; }
public User? ModifiedBy { get; set; }
public Guid? ParentId { get; set; }
public Layer? Parent { get; set; }
#endregion
}
Import,
Processed,
Administration
}
public class Layer
{
#region Properties
[Key]
public Guid Id { get; init; }
[Required]
public int Number { get; init; }
[Required]
[MaxLength(50)]
public string? Name { get; set; }
[Required]
public LayerType Type { get; init; }
[Required]
public DateTime CreatedAt { get; set; }
[Required]
public DateTime ModifiedAt { get; set; }
[Required]
public bool IsDeleted { get; init; }
#endregion
#region Relations
public ICollection<Record>? Records { get; init; }
[Required]
public Guid CreatedById { get; set; }
public User? CreatedBy { get; init; }
[Required]
public Guid ModifiedById { get; set; }
public User? ModifiedBy { get; init; }
public Guid? ParentId { get; init; }
public Layer? Parent { get; init; }
#endregion
}