From 00317a3c12f49a4501945c6efe428e396036ddbb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 30 Oct 2025 17:01:44 +0100 Subject: [PATCH] Fix migrations nuovi modelli tags --- EgwCoreLib.Lux.Data/DataLayerContext.cs | 24 + .../DbModel/Task/JobStepModel.cs | 6 + .../DbModel/Task/JobStepTagModel.cs | 23 + .../DbModel/Task/JobTaskModel.cs | 5 + .../DbModel/Task/JobTaskTagModel.cs | 23 + .../DbModel/Utils/TagsModel.cs | 20 +- ...r.cs => 20251030155842_InidDb.Designer.cs} | 358 +++++++--- ...729_InitDb.cs => 20251030155842_InidDb.cs} | 614 +++++++++++------- .../DataLayerContextModelSnapshot.cs | 354 ++++++++-- EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs | 42 +- 10 files changed, 1067 insertions(+), 402 deletions(-) create mode 100644 EgwCoreLib.Lux.Data/DbModel/Task/JobStepTagModel.cs create mode 100644 EgwCoreLib.Lux.Data/DbModel/Task/JobTaskTagModel.cs rename EgwCoreLib.Lux.Data/Migrations/{20251030090729_InitDb.Designer.cs => 20251030155842_InidDb.Designer.cs} (92%) rename EgwCoreLib.Lux.Data/Migrations/{20251030090729_InitDb.cs => 20251030155842_InidDb.cs} (84%) diff --git a/EgwCoreLib.Lux.Data/DataLayerContext.cs b/EgwCoreLib.Lux.Data/DataLayerContext.cs index e6dd4e1b..7c960c2f 100644 --- a/EgwCoreLib.Lux.Data/DataLayerContext.cs +++ b/EgwCoreLib.Lux.Data/DataLayerContext.cs @@ -115,6 +115,30 @@ namespace EgwCoreLib.Lux.Data relationship.DeleteBehavior = DeleteBehavior.Restrict; } + // fig key relazioni Tags + modelBuilder.Entity() + .HasKey(jtt => new { jtt.JobID, jtt.CodTag }); + modelBuilder.Entity() + .HasKey(jtt => new { jtt.JobStepID, jtt.CodTag }); + +#if false + // JobTask ↔ Tags + modelBuilder.Entity() + .HasOne(j => j.JobTaskNav) + .WithMany(t => t.TagNav) + .HasForeignKey(j => j.JobID); + modelBuilder.Entity() + .HasOne(j => j.TagNav) + .WithMany(t => t.JobTaskNav) + .HasForeignKey(j => j.cod); + + // JobStep ↔ Tags + modelBuilder.Entity() + .HasMany(js => js.TagNav) + .WithMany(t => t.JobSteps) + .UsingEntity(j => j.ToTable("JobStepTags")); +#endif + // fix chiavi multiple modelBuilder.Entity() .HasKey(c => new { c.RefYear, c.CountName}); diff --git a/EgwCoreLib.Lux.Data/DbModel/Task/JobStepModel.cs b/EgwCoreLib.Lux.Data/DbModel/Task/JobStepModel.cs index ca43c798..bdd1f3ec 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Task/JobStepModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Task/JobStepModel.cs @@ -1,5 +1,6 @@ using EgwCoreLib.Lux.Data.DbModel.Cost; using EgwCoreLib.Lux.Data.DbModel.Task; +using EgwCoreLib.Lux.Data.DbModel.Utils; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -102,5 +103,10 @@ namespace EgwCoreLib.Lux.Data.DbModel.Task /// [ForeignKey("ResourceID")] public virtual ResourceModel ResourceNav { get; set; } = null!; + + /// + /// Many-to-many with Tags + /// + public virtual ICollection TagNav { get; set; } = new List(); } } diff --git a/EgwCoreLib.Lux.Data/DbModel/Task/JobStepTagModel.cs b/EgwCoreLib.Lux.Data/DbModel/Task/JobStepTagModel.cs new file mode 100644 index 00000000..c1b3ad03 --- /dev/null +++ b/EgwCoreLib.Lux.Data/DbModel/Task/JobStepTagModel.cs @@ -0,0 +1,23 @@ +using EgwCoreLib.Lux.Data.DbModel.Utils; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EgwCoreLib.Lux.Data.DbModel.Task +{ + [Table("task_job_step_tag")] + public class JobStepTagModel + { + public int JobStepID { get; set; } + public string CodTag { get; set; } + + [ForeignKey("JobStepID")] + public virtual JobStepModel JobStepNav { get; set; } = null!; + + [ForeignKey("CodTag")] + public virtual TagsModel TagNav { get; set; } = null!; + } +} diff --git a/EgwCoreLib.Lux.Data/DbModel/Task/JobTaskModel.cs b/EgwCoreLib.Lux.Data/DbModel/Task/JobTaskModel.cs index 4e9ae65d..5f4eaf39 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Task/JobTaskModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Task/JobTaskModel.cs @@ -39,6 +39,11 @@ namespace EgwCoreLib.Lux.Data.DbModel.Task /// public bool Enabled { get; set; } = true; + /// + /// Many-to-many with Tags + /// + public virtual ICollection TagNav { get; set; } = new List(); + /// /// Navigation verso JobStep /// diff --git a/EgwCoreLib.Lux.Data/DbModel/Task/JobTaskTagModel.cs b/EgwCoreLib.Lux.Data/DbModel/Task/JobTaskTagModel.cs new file mode 100644 index 00000000..fb868c75 --- /dev/null +++ b/EgwCoreLib.Lux.Data/DbModel/Task/JobTaskTagModel.cs @@ -0,0 +1,23 @@ +using EgwCoreLib.Lux.Data.DbModel.Utils; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EgwCoreLib.Lux.Data.DbModel.Task +{ + [Table("task_job_task_tag")] + public class JobTaskTagModel + { + public int JobID { get; set; } + public string CodTag { get; set; } + + [ForeignKey("JobID")] + public virtual JobTaskModel JobNav { get; set; } = null!; + + [ForeignKey("CodTag")] + public virtual TagsModel TagNav { get; set; } = null!; + } +} diff --git a/EgwCoreLib.Lux.Data/DbModel/Utils/TagsModel.cs b/EgwCoreLib.Lux.Data/DbModel/Utils/TagsModel.cs index 1529bf12..dee3cf59 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Utils/TagsModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Utils/TagsModel.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; +using EgwCoreLib.Lux.Data.DbModel.Task; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EgwCoreLib.Lux.Data.DbModel.Utils { @@ -16,14 +12,20 @@ namespace EgwCoreLib.Lux.Data.DbModel.Utils public class TagsModel { /// - /// ID del record TAG + /// Codice del TAG /// [Key] - public int TagID { get; set; } + public string CodTag { get; set; } = ""; + /// - /// Descrizione del Tag + /// Many-to-many with JobTask /// - public string Description { get; set; } = ""; + public ICollection JobTasks { get; set; } = new List(); + + /// + /// Many-to-many with JobStep + /// + public ICollection JobSteps { get; set; } = new List(); } } diff --git a/EgwCoreLib.Lux.Data/Migrations/20251030090729_InitDb.Designer.cs b/EgwCoreLib.Lux.Data/Migrations/20251030155842_InidDb.Designer.cs similarity index 92% rename from EgwCoreLib.Lux.Data/Migrations/20251030090729_InitDb.Designer.cs rename to EgwCoreLib.Lux.Data/Migrations/20251030155842_InidDb.Designer.cs index 9031d509..3c2f437c 100644 --- a/EgwCoreLib.Lux.Data/Migrations/20251030090729_InitDb.Designer.cs +++ b/EgwCoreLib.Lux.Data/Migrations/20251030155842_InidDb.Designer.cs @@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace EgwCoreLib.Lux.Data.Migrations { [DbContext(typeof(DataLayerContext))] - [Migration("20251030090729_InitDb")] - partial class InitDb + [Migration("20251030155842_InidDb")] + partial class InidDb { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -1293,13 +1293,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 1, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3256), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3257), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4725), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4727), OffertState = 0, RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3254) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4723) }, new { @@ -1313,13 +1313,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 2, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3274), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3276), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4745), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4747), OffertState = 0, RefNum = 2, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3273) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4743) }, new { @@ -1333,13 +1333,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 4, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3284), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3285), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4756), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4758), OffertState = 0, RefNum = 3, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3282) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4755) }, new { @@ -1353,13 +1353,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 3, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3293), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3294), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4766), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4767), OffertState = 0, RefNum = 4, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3292) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4764) }); }); @@ -1478,12 +1478,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3439), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4888), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3441), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4890), Note = "Finestra Anta Singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000002", @@ -1508,12 +1508,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3453), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4902), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3455), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4904), Note = "Finestra Vetro Fisso 2025", OfferID = 1, OfferRowUID = "SOR.25.00000001", @@ -1538,12 +1538,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3465), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4915), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3467), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4916), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000003", @@ -1568,12 +1568,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3478), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4927), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3479), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4929), Note = "Installazione serramento", OfferID = 1, OfferRowUID = "SOR.25.00000004", @@ -1598,12 +1598,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3510), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4959), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3512), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4961), Note = "Demo file 01", OfferID = 2, OfferRowUID = "SOR.25.00000005", @@ -1628,12 +1628,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3523), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4972), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3524), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4973), Note = "Demo file 02", OfferID = 2, OfferRowUID = "SOR.25.00000006", @@ -1658,12 +1658,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3554), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5002), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3555), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5004), Note = "Demo file 01", OfferID = 3, OfferRowUID = "SOR.25.00000007", @@ -1688,12 +1688,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3566), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5014), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3567), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5016), Note = "Demo file 02", OfferID = 3, OfferRowUID = "SOR.25.00000008", @@ -1718,12 +1718,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3595), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5044), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3597), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5046), Note = "Demo file 01", OfferID = 4, OfferRowUID = "SOR.25.00000009", @@ -1748,12 +1748,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3608), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5057), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3609), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5059), Note = "Demo file 02", OfferID = 4, OfferRowUID = "SOR.25.0000000A", @@ -2002,8 +2002,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 1, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7040), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7092), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8841), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8913), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -2015,8 +2015,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 2, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7094), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7096), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8916), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8917), MovCod = "CAR", Note = "DEMO", QtyRec = 8.0, @@ -2028,8 +2028,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 3, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7098), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7099), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8919), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8921), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -2041,8 +2041,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 4, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7102), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7103), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8923), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8924), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2054,8 +2054,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 5, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7105), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7106), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8926), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8928), MovCod = "CAR", Note = "DEMO", QtyRec = 10.0, @@ -2067,8 +2067,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 6, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7109), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7110), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8930), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8931), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2080,8 +2080,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 7, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7112), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7113), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8934), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8935), MovCod = "CAR", Note = "DEMO", QtyRec = 50.0, @@ -2093,8 +2093,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 8, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7116), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7117), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8937), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8938), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2106,8 +2106,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 9, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7119), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7120), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8941), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8942), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2119,8 +2119,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 10, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7122), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7124), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8944), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8945), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2516,6 +2516,9 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("ResourceID") .HasColumnType("int"); + b.Property("TagsModelCodTag") + .HasColumnType("varchar(255)"); + b.HasKey("JobStepID"); b.HasIndex("JobID"); @@ -2524,6 +2527,8 @@ namespace EgwCoreLib.Lux.Data.Migrations b.HasIndex("ResourceID"); + b.HasIndex("TagsModelCodTag"); + b.ToTable("task_job_step"); b.HasData( @@ -2589,6 +2594,73 @@ namespace EgwCoreLib.Lux.Data.Migrations }); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobStepTagModel", b => + { + b.Property("JobStepID") + .HasColumnType("int"); + + b.Property("CodTag") + .HasColumnType("varchar(255)"); + + b.HasKey("JobStepID", "CodTag"); + + b.HasIndex("CodTag"); + + b.ToTable("task_job_step_tag"); + + b.HasData( + new + { + JobStepID = 1, + CodTag = "Serramento" + }, + new + { + JobStepID = 2, + CodTag = "Serramento" + }, + new + { + JobStepID = 3, + CodTag = "Serramento" + }, + new + { + JobStepID = 4, + CodTag = "Serramento" + }, + new + { + JobStepID = 5, + CodTag = "Serramento" + }, + new + { + JobStepID = 6, + CodTag = "Serramento" + }, + new + { + JobStepID = 2, + CodTag = "LineaCNC" + }, + new + { + JobStepID = 4, + CodTag = "Montaggio" + }, + new + { + JobStepID = 5, + CodTag = "Servizi" + }, + new + { + JobStepID = 2, + CodTag = "LineaManuale" + }); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", b => { b.Property("JobID") @@ -2610,8 +2682,13 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("Lock") .HasColumnType("tinyint(1)"); + b.Property("TagsModelCodTag") + .HasColumnType("varchar(255)"); + b.HasKey("JobID"); + b.HasIndex("TagsModelCodTag"); + b.ToTable("task_job"); b.HasData( @@ -2673,6 +2750,58 @@ namespace EgwCoreLib.Lux.Data.Migrations }); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskTagModel", b => + { + b.Property("JobID") + .HasColumnType("int"); + + b.Property("CodTag") + .HasColumnType("varchar(255)"); + + b.HasKey("JobID", "CodTag"); + + b.HasIndex("CodTag"); + + b.ToTable("task_job_task_tag"); + + b.HasData( + new + { + JobID = 1, + CodTag = "Rivendita" + }, + new + { + JobID = 2, + CodTag = "Serramento" + }, + new + { + JobID = 3, + CodTag = "Trave" + }, + new + { + JobID = 4, + CodTag = "Cabinet" + }, + new + { + JobID = 5, + CodTag = "Parete" + }, + new + { + JobID = 6, + CodTag = "Serramento" + }, + new + { + JobID = 7, + CodTag = "Serramento" + }); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.PhaseModel", b => { b.Property("PhaseID") @@ -2951,45 +3080,61 @@ namespace EgwCoreLib.Lux.Data.Migrations modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", b => { - b.Property("TagID") - .ValueGeneratedOnAdd() - .HasColumnType("int"); + b.Property("CodTag") + .HasColumnType("varchar(255)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TagID")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("TagID"); + b.HasKey("CodTag"); b.ToTable("utils_tags"); b.HasData( new { - TagID = 1, - Description = "Tag 01" + CodTag = "Cabinet" }, new { - TagID = 2, - Description = "Tag 02" + CodTag = "LineaCNC" }, new { - TagID = 3, - Description = "Tag 03" + CodTag = "LineaManuale" }, new { - TagID = 4, - Description = "Tag 04" + CodTag = "Montaggio" }, new { - TagID = 5, - Description = "Tag 05" + CodTag = "Parete" + }, + new + { + CodTag = "Rivendita" + }, + new + { + CodTag = "Serramento" + }, + new + { + CodTag = "Servizi" + }, + new + { + CodTag = "Trave" + }, + new + { + CodTag = "Trave_200x200" + }, + new + { + CodTag = "Trave_400x400" + }, + new + { + CodTag = "Trave_800x600" }); }); @@ -3250,6 +3395,11 @@ namespace EgwCoreLib.Lux.Data.Migrations .OnDelete(DeleteBehavior.Restrict) .IsRequired(); + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", null) + .WithMany("JobSteps") + .HasForeignKey("TagsModelCodTag") + .OnDelete(DeleteBehavior.Restrict); + b.Navigation("JobNav"); b.Navigation("PhaseNav"); @@ -3257,6 +3407,52 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Navigation("ResourceNav"); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobStepTagModel", b => + { + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", "TagNav") + .WithMany() + .HasForeignKey("CodTag") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Task.JobStepModel", "JobStepNav") + .WithMany("TagNav") + .HasForeignKey("JobStepID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("JobStepNav"); + + b.Navigation("TagNav"); + }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", b => + { + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", null) + .WithMany("JobTasks") + .HasForeignKey("TagsModelCodTag") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskTagModel", b => + { + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", "TagNav") + .WithMany() + .HasForeignKey("CodTag") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", "JobNav") + .WithMany("TagNav") + .HasForeignKey("JobID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("JobNav"); + + b.Navigation("TagNav"); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.GenValueModel", b => { b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.GenClassModel", "GenClassNav") @@ -3278,15 +3474,29 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Navigation("OrderRowNav"); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobStepModel", b => + { + b.Navigation("TagNav"); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", b => { b.Navigation("JobStepNav"); + + b.Navigation("TagNav"); }); modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.GenClassModel", b => { b.Navigation("GenValNav"); }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", b => + { + b.Navigation("JobSteps"); + + b.Navigation("JobTasks"); + }); #pragma warning restore 612, 618 } } diff --git a/EgwCoreLib.Lux.Data/Migrations/20251030090729_InitDb.cs b/EgwCoreLib.Lux.Data/Migrations/20251030155842_InidDb.cs similarity index 84% rename from EgwCoreLib.Lux.Data/Migrations/20251030090729_InitDb.cs rename to EgwCoreLib.Lux.Data/Migrations/20251030155842_InidDb.cs index 4d3b6163..ebdc03a7 100644 --- a/EgwCoreLib.Lux.Data/Migrations/20251030090729_InitDb.cs +++ b/EgwCoreLib.Lux.Data/Migrations/20251030155842_InidDb.cs @@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace EgwCoreLib.Lux.Data.Migrations { /// - public partial class InitDb : Migration + public partial class InidDb : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -200,24 +200,6 @@ namespace EgwCoreLib.Lux.Data.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( - name: "task_job", - columns: table => new - { - JobID = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Index = table.Column(type: "int", nullable: false), - Lock = table.Column(type: "tinyint(1)", nullable: false), - Enabled = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_task_job", x => x.JobID); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( name: "task_job_driver", columns: table => new @@ -303,14 +285,12 @@ namespace EgwCoreLib.Lux.Data.Migrations name: "utils_tags", columns: table => new { - TagID = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(type: "longtext", nullable: false) + CodTag = table.Column(type: "varchar(255)", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { - table.PrimaryKey("PK_utils_tags", x => x.TagID); + table.PrimaryKey("PK_utils_tags", x => x.CodTag); }) .Annotation("MySql:CharSet", "utf8mb4"); @@ -427,82 +407,6 @@ namespace EgwCoreLib.Lux.Data.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( - name: "item_selling_item", - columns: table => new - { - SellingItemID = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Envir = table.Column(type: "int", nullable: false), - IsService = table.Column(type: "tinyint(1)", nullable: false), - JobID = table.Column(type: "int", nullable: false), - ItemCode = table.Column(type: "int", nullable: false), - ExtItemCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SupplCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Cost = table.Column(type: "double", nullable: false), - Margin = table.Column(type: "double", nullable: false), - UM = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SerStruct = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ItemSteps = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_item_selling_item", x => x.SellingItemID); - table.ForeignKey( - name: "FK_item_selling_item_task_job_JobID", - column: x => x.JobID, - principalTable: "task_job", - principalColumn: "JobID", - onDelete: ReferentialAction.Restrict); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "task_job_driver_config", - columns: table => new - { - JobDriverConfID = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - JobID = table.Column(type: "int", nullable: false), - JobDriverID = table.Column(type: "int", nullable: false), - CostDriverID = table.Column(type: "int", nullable: false), - Note = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DefaultVal = table.Column(type: "double", nullable: false), - Intercept = table.Column(type: "double", nullable: false), - Regress = table.Column(type: "double", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_task_job_driver_config", x => x.JobDriverConfID); - table.ForeignKey( - name: "FK_task_job_driver_config_cost_driver_CostDriverID", - column: x => x.CostDriverID, - principalTable: "cost_driver", - principalColumn: "CostDriverID", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_task_job_driver_config_task_job_JobID", - column: x => x.JobID, - principalTable: "task_job", - principalColumn: "JobID", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_task_job_driver_config_task_job_driver_JobDriverID", - column: x => x.JobDriverID, - principalTable: "task_job_driver", - principalColumn: "JobDriverID", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( name: "utils_gen_value", columns: table => new @@ -528,39 +432,27 @@ namespace EgwCoreLib.Lux.Data.Migrations .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( - name: "task_job_step", + name: "task_job", columns: table => new { - JobStepID = table.Column(type: "int", nullable: false) + JobID = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - JobID = table.Column(type: "int", nullable: false), - Index = table.Column(type: "int", nullable: false), - PhaseID = table.Column(type: "int", nullable: false), - ResourceID = table.Column(type: "int", nullable: false), Description = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - ProductivityRate = table.Column(type: "decimal(65,30)", nullable: false) + Index = table.Column(type: "int", nullable: false), + Lock = table.Column(type: "tinyint(1)", nullable: false), + Enabled = table.Column(type: "tinyint(1)", nullable: false), + TagsModelCodTag = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { - table.PrimaryKey("PK_task_job_step", x => x.JobStepID); + table.PrimaryKey("PK_task_job", x => x.JobID); table.ForeignKey( - name: "FK_task_job_step_cost_resource_ResourceID", - column: x => x.ResourceID, - principalTable: "cost_resource", - principalColumn: "ResourceID", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_task_job_step_task_job_JobID", - column: x => x.JobID, - principalTable: "task_job", - principalColumn: "JobID", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_task_job_step_task_phase_PhaseID", - column: x => x.PhaseID, - principalTable: "task_phase", - principalColumn: "PhaseID", + name: "FK_task_job_utils_tags_TagsModelCodTag", + column: x => x.TagsModelCodTag, + principalTable: "utils_tags", + principalColumn: "CodTag", onDelete: ReferentialAction.Restrict); }) .Annotation("MySql:CharSet", "utf8mb4"); @@ -641,6 +533,193 @@ namespace EgwCoreLib.Lux.Data.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "item_selling_item", + columns: table => new + { + SellingItemID = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Envir = table.Column(type: "int", nullable: false), + IsService = table.Column(type: "tinyint(1)", nullable: false), + JobID = table.Column(type: "int", nullable: false), + ItemCode = table.Column(type: "int", nullable: false), + ExtItemCode = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SupplCode = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Cost = table.Column(type: "double", nullable: false), + Margin = table.Column(type: "double", nullable: false), + UM = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SerStruct = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemSteps = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_item_selling_item", x => x.SellingItemID); + table.ForeignKey( + name: "FK_item_selling_item_task_job_JobID", + column: x => x.JobID, + principalTable: "task_job", + principalColumn: "JobID", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "task_job_driver_config", + columns: table => new + { + JobDriverConfID = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + JobID = table.Column(type: "int", nullable: false), + JobDriverID = table.Column(type: "int", nullable: false), + CostDriverID = table.Column(type: "int", nullable: false), + Note = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DefaultVal = table.Column(type: "double", nullable: false), + Intercept = table.Column(type: "double", nullable: false), + Regress = table.Column(type: "double", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_task_job_driver_config", x => x.JobDriverConfID); + table.ForeignKey( + name: "FK_task_job_driver_config_cost_driver_CostDriverID", + column: x => x.CostDriverID, + principalTable: "cost_driver", + principalColumn: "CostDriverID", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_task_job_driver_config_task_job_JobID", + column: x => x.JobID, + principalTable: "task_job", + principalColumn: "JobID", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_task_job_driver_config_task_job_driver_JobDriverID", + column: x => x.JobDriverID, + principalTable: "task_job_driver", + principalColumn: "JobDriverID", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "task_job_step", + columns: table => new + { + JobStepID = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + JobID = table.Column(type: "int", nullable: false), + Index = table.Column(type: "int", nullable: false), + PhaseID = table.Column(type: "int", nullable: false), + ResourceID = table.Column(type: "int", nullable: false), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProductivityRate = table.Column(type: "decimal(65,30)", nullable: false), + TagsModelCodTag = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_task_job_step", x => x.JobStepID); + table.ForeignKey( + name: "FK_task_job_step_cost_resource_ResourceID", + column: x => x.ResourceID, + principalTable: "cost_resource", + principalColumn: "ResourceID", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_task_job_step_task_job_JobID", + column: x => x.JobID, + principalTable: "task_job", + principalColumn: "JobID", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_task_job_step_task_phase_PhaseID", + column: x => x.PhaseID, + principalTable: "task_phase", + principalColumn: "PhaseID", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_task_job_step_utils_tags_TagsModelCodTag", + column: x => x.TagsModelCodTag, + principalTable: "utils_tags", + principalColumn: "CodTag", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "task_job_task_tag", + columns: table => new + { + JobID = table.Column(type: "int", nullable: false), + CodTag = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_task_job_task_tag", x => new { x.JobID, x.CodTag }); + table.ForeignKey( + name: "FK_task_job_task_tag_task_job_JobID", + column: x => x.JobID, + principalTable: "task_job", + principalColumn: "JobID", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_task_job_task_tag_utils_tags_CodTag", + column: x => x.CodTag, + principalTable: "utils_tags", + principalColumn: "CodTag", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "stock_mov", + columns: table => new + { + StockMovID = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + StockStatusId = table.Column(type: "int", nullable: false), + DtCreate = table.Column(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"), + DtMod = table.Column(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn), + QtyRec = table.Column(type: "double", nullable: false), + UnitVal = table.Column(type: "double", nullable: false), + UserId = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + MovCod = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CodDoc = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Note = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_stock_mov", x => x.StockMovID); + table.ForeignKey( + name: "FK_stock_mov_stock_status_StockStatusId", + column: x => x.StockStatusId, + principalTable: "stock_status", + principalColumn: "StockStatusId", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_stock_mov_utils_mov_type_MovCod", + column: x => x.MovCod, + principalTable: "utils_mov_type", + principalColumn: "MovCod", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "sales_offer_row", columns: table => new @@ -700,76 +779,6 @@ namespace EgwCoreLib.Lux.Data.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( - name: "task_job_step_item", - columns: table => new - { - JobStepItemID = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - JobStepID = table.Column(type: "int", nullable: false), - Index = table.Column(type: "int", nullable: false), - ItemID = table.Column(type: "int", nullable: false), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Qty = table.Column(type: "double", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_task_job_step_item", x => x.JobStepItemID); - table.ForeignKey( - name: "FK_task_job_step_item_item_item_ItemID", - column: x => x.ItemID, - principalTable: "item_item", - principalColumn: "ItemID", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_task_job_step_item_task_job_step_JobStepID", - column: x => x.JobStepID, - principalTable: "task_job_step", - principalColumn: "JobStepID", - onDelete: ReferentialAction.Restrict); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "stock_mov", - columns: table => new - { - StockMovID = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - StockStatusId = table.Column(type: "int", nullable: false), - DtCreate = table.Column(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"), - DtMod = table.Column(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn), - QtyRec = table.Column(type: "double", nullable: false), - UnitVal = table.Column(type: "double", nullable: false), - UserId = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MovCod = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CodDoc = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Note = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_stock_mov", x => x.StockMovID); - table.ForeignKey( - name: "FK_stock_mov_stock_status_StockStatusId", - column: x => x.StockStatusId, - principalTable: "stock_status", - principalColumn: "StockStatusId", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_stock_mov_utils_mov_type_MovCod", - column: x => x.MovCod, - principalTable: "utils_mov_type", - principalColumn: "MovCod", - onDelete: ReferentialAction.Restrict); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( name: "sales_order_row", columns: table => new @@ -829,6 +838,63 @@ namespace EgwCoreLib.Lux.Data.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "task_job_step_item", + columns: table => new + { + JobStepItemID = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + JobStepID = table.Column(type: "int", nullable: false), + Index = table.Column(type: "int", nullable: false), + ItemID = table.Column(type: "int", nullable: false), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Qty = table.Column(type: "double", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_task_job_step_item", x => x.JobStepItemID); + table.ForeignKey( + name: "FK_task_job_step_item_item_item_ItemID", + column: x => x.ItemID, + principalTable: "item_item", + principalColumn: "ItemID", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_task_job_step_item_task_job_step_JobStepID", + column: x => x.JobStepID, + principalTable: "task_job_step", + principalColumn: "JobStepID", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "task_job_step_tag", + columns: table => new + { + JobStepID = table.Column(type: "int", nullable: false), + CodTag = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_task_job_step_tag", x => new { x.JobStepID, x.CodTag }); + table.ForeignKey( + name: "FK_task_job_step_tag_task_job_step_JobStepID", + column: x => x.JobStepID, + principalTable: "task_job_step", + principalColumn: "JobStepID", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_task_job_step_tag_utils_tags_CodTag", + column: x => x.CodTag, + principalTable: "utils_tags", + principalColumn: "CodTag", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "production_item", columns: table => new @@ -1000,16 +1066,16 @@ namespace EgwCoreLib.Lux.Data.Migrations migrationBuilder.InsertData( table: "task_job", - columns: new[] { "JobID", "Description", "Enabled", "Index", "Lock" }, + columns: new[] { "JobID", "Description", "Enabled", "Index", "Lock", "TagsModelCodTag" }, values: new object[,] { - { 1, "Rivendita / servizi", true, 4, true }, - { 2, "Serramento Legno - Ciclo Completo con installazione", true, 3, true }, - { 3, "Realizzazione Trave", true, 5, true }, - { 4, "Realizzazione Cabinet", true, 6, true }, - { 5, "Realizzazione Parete", true, 7, true }, - { 6, "Serramento - ciclo base", true, 1, true }, - { 7, "Serramento - ciclo intermedio", true, 2, true } + { 1, "Rivendita / servizi", true, 4, true, null }, + { 2, "Serramento Legno - Ciclo Completo con installazione", true, 3, true, null }, + { 3, "Realizzazione Trave", true, 5, true, null }, + { 4, "Realizzazione Cabinet", true, 6, true, null }, + { 5, "Realizzazione Parete", true, 7, true, null }, + { 6, "Serramento - ciclo base", true, 1, true, null }, + { 7, "Serramento - ciclo intermedio", true, 2, true, null } }); migrationBuilder.InsertData( @@ -1064,14 +1130,21 @@ namespace EgwCoreLib.Lux.Data.Migrations migrationBuilder.InsertData( table: "utils_tags", - columns: new[] { "TagID", "Description" }, - values: new object[,] + column: "CodTag", + values: new object[] { - { 1, "Tag 01" }, - { 2, "Tag 02" }, - { 3, "Tag 03" }, - { 4, "Tag 04" }, - { 5, "Tag 05" } + "Cabinet", + "LineaCNC", + "LineaManuale", + "Montaggio", + "Parete", + "Rivendita", + "Serramento", + "Servizi", + "Trave", + "Trave_200x200", + "Trave_400x400", + "Trave_800x600" }); migrationBuilder.InsertData( @@ -1128,10 +1201,10 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "OfferID", "ConsNote", "CustomerID", "DealerID", "Description", "DictPresel", "Discount", "DueDateProm", "DueDateReq", "Envir", "Inserted", "Modified", "OffertState", "RefNum", "RefRev", "RefYear", "ValidUntil" }, values: new object[,] { - { 1, "", 2, 2, "Offerta per tre serramenti", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 1, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3256), new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3257), 0, 1, 1, 2024, new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3254) }, - { 2, "", 2, 2, "Offerta BEAM", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 2, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3274), new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3276), 0, 2, 1, 2024, new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3273) }, - { 3, "", 2, 2, "Offerta Cabinet", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 4, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3284), new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3285), 0, 3, 1, 2024, new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3282) }, - { 4, "", 2, 2, "Offerta Wall", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 3, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3293), new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3294), 0, 4, 1, 2024, new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3292) } + { 1, "", 2, 2, "Offerta per tre serramenti", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 1, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4725), new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4727), 0, 1, 1, 2024, new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4723) }, + { 2, "", 2, 2, "Offerta BEAM", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 2, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4745), new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4747), 0, 2, 1, 2024, new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4743) }, + { 3, "", 2, 2, "Offerta Cabinet", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 4, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4756), new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4758), 0, 3, 1, 2024, new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4755) }, + { 4, "", 2, 2, "Offerta Wall", "", 0.0, new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), 3, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4766), new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4767), 0, 4, 1, 2024, new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4764) } }); migrationBuilder.InsertData( @@ -1147,6 +1220,20 @@ namespace EgwCoreLib.Lux.Data.Migrations { 6, 1, 8.0, 0.0, 4, 2, "Ore Extra per complex Articolo (1 min/pezzo)", 0.016666666666666666 } }); + migrationBuilder.InsertData( + table: "task_job_task_tag", + columns: new[] { "CodTag", "JobID" }, + values: new object[,] + { + { "Rivendita", 1 }, + { "Serramento", 2 }, + { "Trave", 3 }, + { "Cabinet", 4 }, + { "Parete", 5 }, + { "Serramento", 6 }, + { "Serramento", 7 } + }); + migrationBuilder.InsertData( table: "utils_gen_value", columns: new[] { "GenValID", "ClassCod", "Index", "ValString" }, @@ -1171,16 +1258,16 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "OfferRowID", "AwaitBom", "AwaitPrice", "BomCost", "BomOk", "BomPrice", "Envir", "FileName", "FileResource", "FileSize", "Inserted", "ItemBOM", "ItemJCD", "ItemOk", "ItemSteps", "Modified", "Note", "OfferID", "OfferRowUID", "Qty", "RowNum", "SellingItemID", "SerStruct", "StepCost", "StepFlowTime", "StepLeadTime", "StepPrice" }, values: new object[,] { - { 1, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3453), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3455), "Finestra Vetro Fisso 2025", 1, "SOR.25.00000001", 3.0, 2, 2, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"GroupId\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"GroupId\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0, 0.0, 0.0 }, - { 2, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3439), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3441), "Finestra Anta Singola 2025", 1, "SOR.25.00000002", 3.0, 1, 1, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"GroupId\":1,\"AreaList\":[{\"bIsSashVertical\":true,\"SashList\":[{\"nSashId\":1,\"OpeningType\":\"TILTTURN_LEFT\",\"bHasHandle\":true,\"dDimension\":100.0}],\"SashType\":\"NULL\",\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"Hardware\":\"000558\",\"GroupId\":2,\"AreaList\":[{\"FillType\":\"GLASS\",\"GroupId\":3,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"SASH\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0, 0.0, 0.0 }, - { 3, false, false, 160.0, true, 200.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3465), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3467), "Persiana per Finestra anta singola 2025", 1, "SOR.25.00000003", 3.0, 3, 3, "{}", 0.0, 0.0, 0.0, 0.0 }, - { 4, false, false, 200.0, true, 250.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3478), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3479), "Installazione serramento", 1, "SOR.25.00000004", 3.0, 4, 4, "{}", 0.0, 0.0, 0.0, 0.0 }, - { 5, false, false, 800.0, true, 1150.0, 2, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3510), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3512), "Demo file 01", 2, "SOR.25.00000005", 10.0, 1, 5, "", 0.0, 0.0, 0.0, 0.0 }, - { 6, false, false, 600.0, true, 950.0, 2, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3523), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3524), "Demo file 02", 2, "SOR.25.00000006", 4.0, 1, 5, "", 0.0, 0.0, 0.0, 0.0 }, - { 7, false, false, 200.0, true, 250.0, 3, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3554), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3555), "Demo file 01", 3, "SOR.25.00000007", 4.0, 1, 6, "", 0.0, 0.0, 0.0, 0.0 }, - { 8, false, false, 50.0, true, 80.0, 3, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3566), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3567), "Demo file 02", 3, "SOR.25.00000008", 12.0, 1, 6, "", 0.0, 0.0, 0.0, 0.0 }, - { 9, false, false, 800.0, true, 1150.0, 4, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3595), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3597), "Demo file 01", 4, "SOR.25.00000009", 6.0, 1, 7, "", 0.0, 0.0, 0.0, 0.0 }, - { 10, false, false, 600.0, true, 950.0, 4, "", "", 0L, new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3608), "", "", true, "{}", new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3609), "Demo file 02", 4, "SOR.25.0000000A", 4.0, 1, 7, "", 0.0, 0.0, 0.0, 0.0 } + { 1, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4902), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4904), "Finestra Vetro Fisso 2025", 1, "SOR.25.00000001", 3.0, 2, 2, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"GroupId\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"GroupId\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0, 0.0, 0.0 }, + { 2, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4888), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4890), "Finestra Anta Singola 2025", 1, "SOR.25.00000002", 3.0, 1, 1, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"GroupId\":1,\"AreaList\":[{\"bIsSashVertical\":true,\"SashList\":[{\"nSashId\":1,\"OpeningType\":\"TILTTURN_LEFT\",\"bHasHandle\":true,\"dDimension\":100.0}],\"SashType\":\"NULL\",\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"Hardware\":\"000558\",\"GroupId\":2,\"AreaList\":[{\"FillType\":\"GLASS\",\"GroupId\":3,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"SASH\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0, 0.0, 0.0 }, + { 3, false, false, 160.0, true, 200.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4915), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4916), "Persiana per Finestra anta singola 2025", 1, "SOR.25.00000003", 3.0, 3, 3, "{}", 0.0, 0.0, 0.0, 0.0 }, + { 4, false, false, 200.0, true, 250.0, 1, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4927), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4929), "Installazione serramento", 1, "SOR.25.00000004", 3.0, 4, 4, "{}", 0.0, 0.0, 0.0, 0.0 }, + { 5, false, false, 800.0, true, 1150.0, 2, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4959), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4961), "Demo file 01", 2, "SOR.25.00000005", 10.0, 1, 5, "", 0.0, 0.0, 0.0, 0.0 }, + { 6, false, false, 600.0, true, 950.0, 2, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4972), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4973), "Demo file 02", 2, "SOR.25.00000006", 4.0, 1, 5, "", 0.0, 0.0, 0.0, 0.0 }, + { 7, false, false, 200.0, true, 250.0, 3, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5002), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5004), "Demo file 01", 3, "SOR.25.00000007", 4.0, 1, 6, "", 0.0, 0.0, 0.0, 0.0 }, + { 8, false, false, 50.0, true, 80.0, 3, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5014), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5016), "Demo file 02", 3, "SOR.25.00000008", 12.0, 1, 6, "", 0.0, 0.0, 0.0, 0.0 }, + { 9, false, false, 800.0, true, 1150.0, 4, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5044), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5046), "Demo file 01", 4, "SOR.25.00000009", 6.0, 1, 7, "", 0.0, 0.0, 0.0, 0.0 }, + { 10, false, false, 600.0, true, 950.0, 4, "", "", 0L, new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5057), "", "", true, "{}", new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5059), "Demo file 02", 4, "SOR.25.0000000A", 4.0, 1, 7, "", 0.0, 0.0, 0.0, 0.0 } }); migrationBuilder.InsertData( @@ -1202,15 +1289,15 @@ namespace EgwCoreLib.Lux.Data.Migrations migrationBuilder.InsertData( table: "task_job_step", - columns: new[] { "JobStepID", "Description", "Index", "JobID", "PhaseID", "ProductivityRate", "ResourceID" }, + columns: new[] { "JobStepID", "Description", "Index", "JobID", "PhaseID", "ProductivityRate", "ResourceID", "TagsModelCodTag" }, values: new object[,] { - { 1, "Preparazione Tronchetti", 1, 2, 1, 1m, 3 }, - { 2, "Taglio profilo", 2, 2, 2, 1m, 4 }, - { 3, "Verniciatura", 3, 2, 3, 1m, 6 }, - { 4, "Assemblaggio Serramento", 4, 2, 4, 1m, 8 }, - { 5, "Installazione cliente", 5, 2, 6, 1m, 9 }, - { 6, "Produzione Serramento (media annua)", 1, 6, 7, 1m, 2 } + { 1, "Preparazione Tronchetti", 1, 2, 1, 1m, 3, null }, + { 2, "Taglio profilo", 2, 2, 2, 1m, 4, null }, + { 3, "Verniciatura", 3, 2, 3, 1m, 6, null }, + { 4, "Assemblaggio Serramento", 4, 2, 4, 1m, 8, null }, + { 5, "Installazione cliente", 5, 2, 6, 1m, 9, null }, + { 6, "Produzione Serramento (media annua)", 1, 6, 7, 1m, 2, null } }); migrationBuilder.InsertData( @@ -1218,16 +1305,16 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "StockMovID", "CodDoc", "DtCreate", "MovCod", "Note", "QtyRec", "StockStatusId", "UnitVal", "UserId" }, values: new object[,] { - { 1, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7040), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" }, - { 2, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7094), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" }, - { 3, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7098), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" }, - { 4, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7102), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" }, - { 5, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7105), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" }, - { 6, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7109), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" }, - { 7, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7112), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" }, - { 8, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7116), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" }, - { 9, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7119), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" }, - { 10, "", new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7122), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" } + { 1, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8841), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" }, + { 2, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8916), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" }, + { 3, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8919), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" }, + { 4, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8923), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" }, + { 5, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8926), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" }, + { 6, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8930), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" }, + { 7, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8934), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" }, + { 8, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8937), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" }, + { 9, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8941), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" }, + { 10, "", new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8944), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" } }); migrationBuilder.InsertData( @@ -1240,6 +1327,23 @@ namespace EgwCoreLib.Lux.Data.Migrations { 3, "Ferramenta AGB - rif. AGFD.00000.00000", 3, 9, 4, 1.0 } }); + migrationBuilder.InsertData( + table: "task_job_step_tag", + columns: new[] { "CodTag", "JobStepID" }, + values: new object[,] + { + { "Serramento", 1 }, + { "LineaCNC", 2 }, + { "LineaManuale", 2 }, + { "Serramento", 2 }, + { "Serramento", 3 }, + { "Montaggio", 4 }, + { "Serramento", 4 }, + { "Serramento", 5 }, + { "Servizi", 5 }, + { "Serramento", 6 } + }); + migrationBuilder.CreateIndex( name: "IX_cost_resource_CostDriverID", table: "cost_resource", @@ -1340,6 +1444,11 @@ namespace EgwCoreLib.Lux.Data.Migrations table: "stock_status", column: "ItemID"); + migrationBuilder.CreateIndex( + name: "IX_task_job_TagsModelCodTag", + table: "task_job", + column: "TagsModelCodTag"); + migrationBuilder.CreateIndex( name: "IX_task_job_driver_config_CostDriverID", table: "task_job_driver_config", @@ -1370,6 +1479,11 @@ namespace EgwCoreLib.Lux.Data.Migrations table: "task_job_step", column: "ResourceID"); + migrationBuilder.CreateIndex( + name: "IX_task_job_step_TagsModelCodTag", + table: "task_job_step", + column: "TagsModelCodTag"); + migrationBuilder.CreateIndex( name: "IX_task_job_step_item_ItemID", table: "task_job_step_item", @@ -1380,6 +1494,16 @@ namespace EgwCoreLib.Lux.Data.Migrations table: "task_job_step_item", column: "JobStepID"); + migrationBuilder.CreateIndex( + name: "IX_task_job_step_tag_CodTag", + table: "task_job_step_tag", + column: "CodTag"); + + migrationBuilder.CreateIndex( + name: "IX_task_job_task_tag_CodTag", + table: "task_job_task_tag", + column: "CodTag"); + migrationBuilder.CreateIndex( name: "IX_utils_gen_value_ClassCod", table: "utils_gen_value", @@ -1419,15 +1543,18 @@ namespace EgwCoreLib.Lux.Data.Migrations migrationBuilder.DropTable( name: "task_job_step_item"); + migrationBuilder.DropTable( + name: "task_job_step_tag"); + + migrationBuilder.DropTable( + name: "task_job_task_tag"); + migrationBuilder.DropTable( name: "utils_counter"); migrationBuilder.DropTable( name: "utils_gen_value"); - migrationBuilder.DropTable( - name: "utils_tags"); - migrationBuilder.DropTable( name: "production_item"); @@ -1479,6 +1606,9 @@ namespace EgwCoreLib.Lux.Data.Migrations migrationBuilder.DropTable( name: "sales_offer"); + migrationBuilder.DropTable( + name: "utils_tags"); + migrationBuilder.DropTable( name: "sales_customer"); diff --git a/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs b/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs index 70bf92ec..5fadf835 100644 --- a/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs +++ b/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs @@ -1290,13 +1290,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 1, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3256), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3257), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4725), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4727), OffertState = 0, RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3254) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4723) }, new { @@ -1310,13 +1310,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 2, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3274), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3276), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4745), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4747), OffertState = 0, RefNum = 2, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3273) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4743) }, new { @@ -1330,13 +1330,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 4, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3284), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3285), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4756), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4758), OffertState = 0, RefNum = 3, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3282) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4755) }, new { @@ -1350,13 +1350,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 29, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 29, 0, 0, 0, 0, DateTimeKind.Local), Envir = 3, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3293), - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3294), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4766), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4767), OffertState = 0, RefNum = 4, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3292) + ValidUntil = new DateTime(2025, 11, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4764) }); }); @@ -1475,12 +1475,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3439), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4888), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3441), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4890), Note = "Finestra Anta Singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000002", @@ -1505,12 +1505,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3453), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4902), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3455), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4904), Note = "Finestra Vetro Fisso 2025", OfferID = 1, OfferRowUID = "SOR.25.00000001", @@ -1535,12 +1535,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3465), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4915), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3467), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4916), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000003", @@ -1565,12 +1565,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3478), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4927), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3479), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4929), Note = "Installazione serramento", OfferID = 1, OfferRowUID = "SOR.25.00000004", @@ -1595,12 +1595,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3510), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4959), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3512), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4961), Note = "Demo file 01", OfferID = 2, OfferRowUID = "SOR.25.00000005", @@ -1625,12 +1625,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3523), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4972), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3524), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(4973), Note = "Demo file 02", OfferID = 2, OfferRowUID = "SOR.25.00000006", @@ -1655,12 +1655,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3554), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5002), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3555), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5004), Note = "Demo file 01", OfferID = 3, OfferRowUID = "SOR.25.00000007", @@ -1685,12 +1685,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3566), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5014), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3567), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5016), Note = "Demo file 02", OfferID = 3, OfferRowUID = "SOR.25.00000008", @@ -1715,12 +1715,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3595), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5044), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3597), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5046), Note = "Demo file 01", OfferID = 4, OfferRowUID = "SOR.25.00000009", @@ -1745,12 +1745,12 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3608), + Inserted = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5057), ItemBOM = "", ItemJCD = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 30, 10, 7, 29, 146, DateTimeKind.Local).AddTicks(3609), + Modified = new DateTime(2025, 10, 30, 16, 58, 41, 494, DateTimeKind.Local).AddTicks(5059), Note = "Demo file 02", OfferID = 4, OfferRowUID = "SOR.25.0000000A", @@ -1999,8 +1999,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 1, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7040), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7092), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8841), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8913), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -2012,8 +2012,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 2, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7094), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7096), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8916), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8917), MovCod = "CAR", Note = "DEMO", QtyRec = 8.0, @@ -2025,8 +2025,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 3, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7098), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7099), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8919), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8921), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -2038,8 +2038,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 4, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7102), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7103), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8923), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8924), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2051,8 +2051,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 5, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7105), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7106), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8926), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8928), MovCod = "CAR", Note = "DEMO", QtyRec = 10.0, @@ -2064,8 +2064,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 6, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7109), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7110), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8930), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8931), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2077,8 +2077,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 7, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7112), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7113), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8934), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8935), MovCod = "CAR", Note = "DEMO", QtyRec = 50.0, @@ -2090,8 +2090,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 8, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7116), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7117), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8937), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8938), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2103,8 +2103,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 9, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7119), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7120), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8941), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8942), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2116,8 +2116,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 10, CodDoc = "", - DtCreate = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7122), - DtMod = new DateTime(2025, 10, 30, 10, 7, 29, 142, DateTimeKind.Local).AddTicks(7124), + DtCreate = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8944), + DtMod = new DateTime(2025, 10, 30, 16, 58, 41, 490, DateTimeKind.Local).AddTicks(8945), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2513,6 +2513,9 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("ResourceID") .HasColumnType("int"); + b.Property("TagsModelCodTag") + .HasColumnType("varchar(255)"); + b.HasKey("JobStepID"); b.HasIndex("JobID"); @@ -2521,6 +2524,8 @@ namespace EgwCoreLib.Lux.Data.Migrations b.HasIndex("ResourceID"); + b.HasIndex("TagsModelCodTag"); + b.ToTable("task_job_step"); b.HasData( @@ -2586,6 +2591,73 @@ namespace EgwCoreLib.Lux.Data.Migrations }); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobStepTagModel", b => + { + b.Property("JobStepID") + .HasColumnType("int"); + + b.Property("CodTag") + .HasColumnType("varchar(255)"); + + b.HasKey("JobStepID", "CodTag"); + + b.HasIndex("CodTag"); + + b.ToTable("task_job_step_tag"); + + b.HasData( + new + { + JobStepID = 1, + CodTag = "Serramento" + }, + new + { + JobStepID = 2, + CodTag = "Serramento" + }, + new + { + JobStepID = 3, + CodTag = "Serramento" + }, + new + { + JobStepID = 4, + CodTag = "Serramento" + }, + new + { + JobStepID = 5, + CodTag = "Serramento" + }, + new + { + JobStepID = 6, + CodTag = "Serramento" + }, + new + { + JobStepID = 2, + CodTag = "LineaCNC" + }, + new + { + JobStepID = 4, + CodTag = "Montaggio" + }, + new + { + JobStepID = 5, + CodTag = "Servizi" + }, + new + { + JobStepID = 2, + CodTag = "LineaManuale" + }); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", b => { b.Property("JobID") @@ -2607,8 +2679,13 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("Lock") .HasColumnType("tinyint(1)"); + b.Property("TagsModelCodTag") + .HasColumnType("varchar(255)"); + b.HasKey("JobID"); + b.HasIndex("TagsModelCodTag"); + b.ToTable("task_job"); b.HasData( @@ -2670,6 +2747,58 @@ namespace EgwCoreLib.Lux.Data.Migrations }); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskTagModel", b => + { + b.Property("JobID") + .HasColumnType("int"); + + b.Property("CodTag") + .HasColumnType("varchar(255)"); + + b.HasKey("JobID", "CodTag"); + + b.HasIndex("CodTag"); + + b.ToTable("task_job_task_tag"); + + b.HasData( + new + { + JobID = 1, + CodTag = "Rivendita" + }, + new + { + JobID = 2, + CodTag = "Serramento" + }, + new + { + JobID = 3, + CodTag = "Trave" + }, + new + { + JobID = 4, + CodTag = "Cabinet" + }, + new + { + JobID = 5, + CodTag = "Parete" + }, + new + { + JobID = 6, + CodTag = "Serramento" + }, + new + { + JobID = 7, + CodTag = "Serramento" + }); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.PhaseModel", b => { b.Property("PhaseID") @@ -2948,45 +3077,61 @@ namespace EgwCoreLib.Lux.Data.Migrations modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", b => { - b.Property("TagID") - .ValueGeneratedOnAdd() - .HasColumnType("int"); + b.Property("CodTag") + .HasColumnType("varchar(255)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TagID")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("TagID"); + b.HasKey("CodTag"); b.ToTable("utils_tags"); b.HasData( new { - TagID = 1, - Description = "Tag 01" + CodTag = "Cabinet" }, new { - TagID = 2, - Description = "Tag 02" + CodTag = "LineaCNC" }, new { - TagID = 3, - Description = "Tag 03" + CodTag = "LineaManuale" }, new { - TagID = 4, - Description = "Tag 04" + CodTag = "Montaggio" }, new { - TagID = 5, - Description = "Tag 05" + CodTag = "Parete" + }, + new + { + CodTag = "Rivendita" + }, + new + { + CodTag = "Serramento" + }, + new + { + CodTag = "Servizi" + }, + new + { + CodTag = "Trave" + }, + new + { + CodTag = "Trave_200x200" + }, + new + { + CodTag = "Trave_400x400" + }, + new + { + CodTag = "Trave_800x600" }); }); @@ -3247,6 +3392,11 @@ namespace EgwCoreLib.Lux.Data.Migrations .OnDelete(DeleteBehavior.Restrict) .IsRequired(); + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", null) + .WithMany("JobSteps") + .HasForeignKey("TagsModelCodTag") + .OnDelete(DeleteBehavior.Restrict); + b.Navigation("JobNav"); b.Navigation("PhaseNav"); @@ -3254,6 +3404,52 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Navigation("ResourceNav"); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobStepTagModel", b => + { + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", "TagNav") + .WithMany() + .HasForeignKey("CodTag") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Task.JobStepModel", "JobStepNav") + .WithMany("TagNav") + .HasForeignKey("JobStepID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("JobStepNav"); + + b.Navigation("TagNav"); + }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", b => + { + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", null) + .WithMany("JobTasks") + .HasForeignKey("TagsModelCodTag") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskTagModel", b => + { + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", "TagNav") + .WithMany() + .HasForeignKey("CodTag") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", "JobNav") + .WithMany("TagNav") + .HasForeignKey("JobID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("JobNav"); + + b.Navigation("TagNav"); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.GenValueModel", b => { b.HasOne("EgwCoreLib.Lux.Data.DbModel.Utils.GenClassModel", "GenClassNav") @@ -3275,15 +3471,29 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Navigation("OrderRowNav"); }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobStepModel", b => + { + b.Navigation("TagNav"); + }); + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobTaskModel", b => { b.Navigation("JobStepNav"); + + b.Navigation("TagNav"); }); modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.GenClassModel", b => { b.Navigation("GenValNav"); }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Utils.TagsModel", b => + { + b.Navigation("JobSteps"); + + b.Navigation("JobTasks"); + }); #pragma warning restore 612, 618 } } diff --git a/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs b/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs index ac1b6beb..60e28b68 100644 --- a/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs +++ b/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs @@ -22,11 +22,18 @@ namespace EgwCoreLib.Lux.Data // inizializzazione dei valori di default x Ruoli/Tags modelBuilder.Entity().HasData( - new TagsModel { TagID = 1, Description = "Tag 01" }, - new TagsModel { TagID = 2, Description = "Tag 02" }, - new TagsModel { TagID = 3, Description = "Tag 03" }, - new TagsModel { TagID = 4, Description = "Tag 04" }, - new TagsModel { TagID = 5, Description = "Tag 05" } + new TagsModel { CodTag = "Cabinet" }, + new TagsModel { CodTag = "LineaCNC" }, + new TagsModel { CodTag = "LineaManuale" }, + new TagsModel { CodTag = "Montaggio" }, + new TagsModel { CodTag = "Parete" }, + new TagsModel { CodTag = "Rivendita" }, + new TagsModel { CodTag = "Serramento" }, + new TagsModel { CodTag = "Servizi" }, + new TagsModel { CodTag = "Trave" }, + new TagsModel { CodTag = "Trave_200x200" }, + new TagsModel { CodTag = "Trave_400x400" }, + new TagsModel { CodTag = "Trave_800x600" } ); // init classi generiche x gestione liste @@ -244,6 +251,17 @@ namespace EgwCoreLib.Lux.Data new JobTaskModel { JobID = 7, Description = "Serramento - ciclo intermedio", Index = 2, Lock = true } ); + // initi tag sui cicli + modelBuilder.Entity().HasData( + new { JobID = 1, CodTag = "Rivendita" }, + new { JobID = 2, CodTag = "Serramento" }, + new { JobID = 3, CodTag = "Trave" }, + new { JobID = 4, CodTag = "Cabinet" }, + new { JobID = 5, CodTag = "Parete" }, + new { JobID = 6, CodTag = "Serramento" }, + new { JobID = 7, CodTag = "Serramento" } + ); + // init JobDriverConfig modelBuilder.Entity().HasData( new JobDriverConfigModel() { JobDriverConfID = 1, JobID = 6, JobDriverID = 3, CostDriverID = 3, Note = "Numero prodotti", Intercept = 0, Regress = 1 }, @@ -271,6 +289,20 @@ namespace EgwCoreLib.Lux.Data new JobStepModel { JobStepID = 6, JobID = 6, Index = 1, PhaseID = 7, ProductivityRate = 1M, ResourceID = 2, Description = "Produzione Serramento (media annua)" } ); + // init tag sulle fasi + modelBuilder.Entity().HasData( + new { JobStepID = 1, CodTag = "Serramento" }, + new { JobStepID = 2, CodTag = "Serramento" }, + new { JobStepID = 3, CodTag = "Serramento" }, + new { JobStepID = 4, CodTag = "Serramento" }, + new { JobStepID = 5, CodTag = "Serramento" }, + new { JobStepID = 6, CodTag = "Serramento" }, + new { JobStepID = 2, CodTag = "LineaCNC" }, + new { JobStepID = 4, CodTag = "Montaggio" }, + new { JobStepID = 5, CodTag = "Servizi" }, + new { JobStepID = 2, CodTag = "LineaManuale" } + ); + // init item righe ciclo (articoli + prodotti delle fasi del ciclo) modelBuilder.Entity().HasData( // eventuale scarto del materiale tra grezzo e finito--> porta ad un numero >1 (QUI NON USATO, ho il valore calcolato dal motore)