using EgwCoreLib.Lux.Data.DbModel.Utils; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EgwCoreLib.Lux.Data.DbModel.Stock { // // This is here so CodeMaid doesn't reorganize this document // /// /// Tabella dei movimenti degli item in giacenza /// [Table("stock_mov")] public class StockMovModel { /// /// Primary Key AUTO /// [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int StockMovID { get; set; } /// /// Chiave delle pos di giacenza /// public int StockStatusId { get; set; } /// /// DateTime di creazione record /// public DateTime DtCreate { get; set; } = DateTime.Now; /// /// DateTime registrazione dato /// public DateTime DtMod { get; set; } = DateTime.Now; /// /// ProductivityRate movimento registrato (delta +/-) /// public double QtyRec { get; set; } = 0; /// /// Valore unitario al movimento (costo acquisto / medio per vendita) /// public double UnitVal { get; set; } = 0; [NotMapped] public double TotalVal { get => UnitVal * QtyRec; } /// /// User modificatore /// public string UserId { get; set; } = ""; /// /// Cod movimento magazzino registrato /// public string MovCod { get; set; } = ""; /// /// Cod docuemnto (es DDT) - opzionale /// public string CodDoc { get; set; } = ""; /// /// Note opzionali /// public string Note { get; set; } = ""; /// /// Navigation per giacenze /// [ForeignKey("StockStatusId")] public virtual StockStatusModel StockStatusNav { get; set; } = null!; /// /// Navigation per tipo movimento /// [ForeignKey("MovCod")] public virtual MovTypeModel MovTypeNav { get; set; } = null!; } }