using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace AsbCloudDb.Model.WellSections;

[Table("t_well_section_plan")]
public class WellSectionPlan : IId,
   IWellRelated
{
   [Key] 
   [Column("id")] 
   public int Id { get; set; }

   [Column("id_well"), Comment("Id скважины")]
   public int IdWell { get; set; }

   [Column("id_section_type"), Comment("Тип секции")]
   public int IdSectionType { get; set; }

   [Column("id_user"), Comment("Id пользователя")]
   public int IdUser { get; set; }

   [Column("date_last_update", TypeName = "timestamp with time zone"), Comment("Дата последнего обновления")]
   public DateTimeOffset? LastUpdateDate { get; set; }

   [Column("depth_start"), Comment("Начальная глубина бурения, м")]
   public double DepthStart { get; set; }

   [Column("depth_end"), Comment("Конечная глубина бурения, м")]
   public double DepthEnd { get; set; }

   [Column("outer_diameter"), Comment("Внешний диаметр")]
   public double? OuterDiameter { get; set; }

   [Column("inner_diameter"), Comment("Внутренний диаметр")]
   public double? InnerDiameter { get; set; }

   [ForeignKey(nameof(IdWell))]
   public virtual Well Well { get; set; } = null!;

   [ForeignKey(nameof(IdSectionType))] 
   public virtual WellSectionType SectionType { get; set; } = null!;
}