using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; namespace GazpromApp.Models; public class Equipment { public Equipment() { LocalId = Id == Guid.Empty ? Guid.NewGuid() : Id; } [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [JsonIgnore] public Guid Id { get; set; } [JsonIgnore] [NotMapped] public Guid LocalId { get; set; } [Required] public string? Name { get; set; } = string.Empty; public string? Description { get; set; } = string.Empty; public DateTime CreationDate { get; set; } // Foreign keys [JsonIgnore] public Guid? PointId { get; set; } [JsonIgnore] public List ImageIds { get; set; } = []; [JsonIgnore] public List InspectionIds { get; set; } = []; [JsonIgnore] public List EquipmentIds { get; set; } = []; public Guid? ParentEquipmentId { get; set; } // Navigation Properties public List Images { get; set; } = []; [JsonIgnore] public Point? Point { get; set; } = null!; public List Properties { get; set; } = []; public List Inspections { get; set; } = []; public List Equipments { get; set; } = []; public Equipment? ParentEquipment { get; set; } }