diff --git a/Lux.Data/Migrations/20250707161305_InitDb.Designer.cs b/Lux.Data/Migrations/20250707161305_InitDb.Designer.cs
new file mode 100644
index 00000000..4fad5a82
--- /dev/null
+++ b/Lux.Data/Migrations/20250707161305_InitDb.Designer.cs
@@ -0,0 +1,1693 @@
+//
+using System;
+using Lux.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Lux.Data.Migrations
+{
+ [DbContext(typeof(DataLayerContext))]
+ [Migration("20250707161305_InitDb")]
+ partial class InitDb
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.17")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("Lux.Data.DbModel.CustomerModel", b =>
+ {
+ b.Property("CustomerID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CustomerID"));
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("CustomerID");
+
+ b.ToTable("RegCustomer");
+
+ b.HasData(
+ new
+ {
+ CustomerID = 1,
+ CompanyName = "",
+ FirstName = "Customer A",
+ LastName = "Egalware",
+ VAT = "1234567890123456"
+ },
+ new
+ {
+ CustomerID = 2,
+ CompanyName = "",
+ FirstName = "Customer B",
+ LastName = "User",
+ VAT = "1234567890123456"
+ },
+ new
+ {
+ CustomerID = 3,
+ CompanyName = "",
+ FirstName = "Customer C",
+ LastName = "User Test",
+ VAT = "1234567890123456"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.DealerModel", b =>
+ {
+ b.Property("DealerID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DealerID"));
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("DealerID");
+
+ b.ToTable("RegDealer");
+
+ b.HasData(
+ new
+ {
+ DealerID = 1,
+ CompanyName = "Company First",
+ FirstName = "Dealer A",
+ LastName = "Egalware",
+ VAT = "9587362514671527"
+ },
+ new
+ {
+ DealerID = 2,
+ CompanyName = "Company First",
+ FirstName = "Dealer B",
+ LastName = "User",
+ VAT = "9587362514671527"
+ },
+ new
+ {
+ DealerID = 3,
+ CompanyName = "Company Second",
+ FirstName = "Dealer C",
+ LastName = "User Test",
+ VAT = "9587362514671527"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.ItemModel", b =>
+ {
+ b.Property("ItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ItemID"));
+
+ b.Property("Cost")
+ .HasColumnType("double");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ExtItemCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("IsService")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemCode")
+ .HasColumnType("int");
+
+ b.Property("Margin")
+ .HasColumnType("double");
+
+ b.Property("SupplCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("UM")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("ItemID");
+
+ b.ToTable("RegItem");
+
+ b.HasData(
+ new
+ {
+ ItemID = 1,
+ Cost = 20.0,
+ Description = "BARRA-60x80 generica",
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 1001,
+ Margin = 0.29999999999999999,
+ SupplCode = "BARR.001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 2,
+ Cost = 16.5,
+ Description = "Barra 60x80, lunghezza 12m",
+ ExtItemCode = "BARRA-60x80x12000",
+ IsService = false,
+ ItemCode = 1002,
+ Margin = 0.20999999999999999,
+ SupplCode = "ABC.00123.12000",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 3,
+ Cost = 17.5,
+ Description = "Barra 60x80, lunghezza 8m",
+ ExtItemCode = "BARRA-60x80x8000",
+ IsService = false,
+ ItemCode = 1003,
+ Margin = 0.22,
+ SupplCode = "ABC.00123.8000",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 4,
+ Cost = 15.5,
+ Description = "Barra 60x80, lunghezza 16m",
+ ExtItemCode = "BARRA-60x80x16000",
+ IsService = false,
+ ItemCode = 1004,
+ Margin = 0.20000000000000001,
+ SupplCode = "ABC.00123.16000",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 5,
+ Cost = 300.0,
+ Description = "Vetro triplo, basso indice termico, 800x1000",
+ ExtItemCode = "VETRO-3L-THERMO-800x1000",
+ IsService = false,
+ ItemCode = 2001,
+ Margin = 0.20000000000000001,
+ SupplCode = "V3T.800.1000",
+ UM = "m2"
+ },
+ new
+ {
+ ItemID = 6,
+ Cost = 200.0,
+ Description = "Vetro doppio, 800x1000",
+ ExtItemCode = "VETRO-2L-800x1000",
+ IsService = false,
+ ItemCode = 2002,
+ Margin = 0.14999999999999999,
+ SupplCode = "V2.800.1000",
+ UM = "m2"
+ },
+ new
+ {
+ ItemID = 7,
+ Cost = 250.0,
+ Description = "Vetro triplo, 800x1000",
+ ExtItemCode = "VETRO-3L-800x1000",
+ IsService = false,
+ ItemCode = 2003,
+ Margin = 0.17999999999999999,
+ SupplCode = "V3.800.1000",
+ UM = "m2"
+ },
+ new
+ {
+ ItemID = 8,
+ Cost = 20.0,
+ Description = "Vernice trasparente",
+ ExtItemCode = "VERN-TRASP",
+ IsService = false,
+ ItemCode = 3001,
+ Margin = 0.20000000000000001,
+ SupplCode = "VT.STD",
+ UM = "l"
+ },
+ new
+ {
+ ItemID = 9,
+ Cost = 65.0,
+ Description = "Kit standard completo AGB tipo 001",
+ ExtItemCode = "KIT-001",
+ IsService = false,
+ ItemCode = 5001,
+ Margin = 0.20000000000000001,
+ SupplCode = "AGB-KIT-001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 10,
+ Cost = 10.0,
+ Description = "Cerniera AGB tipo 001",
+ ExtItemCode = "CERN-001",
+ IsService = false,
+ ItemCode = 5002,
+ Margin = 0.20000000000000001,
+ SupplCode = "AGB-CERN-001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 11,
+ Cost = 15.0,
+ Description = "Serratura AGB tipo 001",
+ ExtItemCode = "SERR-001",
+ IsService = false,
+ ItemCode = 5003,
+ Margin = 0.20000000000000001,
+ SupplCode = "AGB-SERR-001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 12,
+ Cost = 25.0,
+ Description = "Maniglia AGB tipo 001",
+ ExtItemCode = "MAN-001",
+ IsService = false,
+ ItemCode = 5004,
+ Margin = 0.20000000000000001,
+ SupplCode = "AGB-MAN-001",
+ UM = "#"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.JobModel", b =>
+ {
+ b.Property("JobID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("JobID"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("JobID");
+
+ b.ToTable("JobList");
+
+ b.HasData(
+ new
+ {
+ JobID = 1,
+ Description = "Rivendita / servizi"
+ },
+ new
+ {
+ JobID = 2,
+ Description = "Serramento Completo Legno su linea Saomad e installatore interno"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.JobRowItemModel", b =>
+ {
+ b.Property("JobRowItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("JobRowItemID"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Index")
+ .HasColumnType("int");
+
+ b.Property("ItemID")
+ .HasColumnType("int");
+
+ b.Property("JobRowID")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.HasKey("JobRowItemID");
+
+ b.HasIndex("ItemID");
+
+ b.HasIndex("JobRowID");
+
+ b.ToTable("JobRowItemList");
+
+ b.HasData(
+ new
+ {
+ JobRowItemID = 1,
+ Description = "Grezzo legno abete",
+ Index = 1,
+ ItemID = 1,
+ JobRowID = 1,
+ Qty = 1.0
+ },
+ new
+ {
+ JobRowItemID = 2,
+ Description = "Vernice trasparente standard 1L",
+ Index = 2,
+ ItemID = 8,
+ JobRowID = 3,
+ Qty = 0.10000000000000001
+ },
+ new
+ {
+ JobRowItemID = 3,
+ Description = "Ferramenta AGB - rif. AGFD.00000.00000",
+ Index = 3,
+ ItemID = 9,
+ JobRowID = 4,
+ Qty = 1.0
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.JobRowModel", b =>
+ {
+ b.Property("JobRowID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("JobRowID"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Index")
+ .HasColumnType("int");
+
+ b.Property("JobID")
+ .HasColumnType("int");
+
+ b.Property("PhaseID")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.Property("ResourceID")
+ .HasColumnType("int");
+
+ b.HasKey("JobRowID");
+
+ b.HasIndex("JobID");
+
+ b.HasIndex("PhaseID");
+
+ b.HasIndex("ResourceID");
+
+ b.ToTable("JobRowList");
+
+ b.HasData(
+ new
+ {
+ JobRowID = 1,
+ Description = "",
+ Index = 1,
+ JobID = 2,
+ PhaseID = 1,
+ Qty = 1.0,
+ ResourceID = 1
+ },
+ new
+ {
+ JobRowID = 2,
+ Description = "",
+ Index = 2,
+ JobID = 2,
+ PhaseID = 2,
+ Qty = 1.0,
+ ResourceID = 2
+ },
+ new
+ {
+ JobRowID = 3,
+ Description = "",
+ Index = 3,
+ JobID = 2,
+ PhaseID = 3,
+ Qty = 1.0,
+ ResourceID = 4
+ },
+ new
+ {
+ JobRowID = 4,
+ Description = "",
+ Index = 4,
+ JobID = 2,
+ PhaseID = 4,
+ Qty = 1.0,
+ ResourceID = 6
+ },
+ new
+ {
+ JobRowID = 5,
+ Description = "",
+ Index = 5,
+ JobID = 2,
+ PhaseID = 6,
+ Qty = 1.0,
+ ResourceID = 7
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OfferModel", b =>
+ {
+ b.Property("OfferID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OfferID"));
+
+ b.Property("CustomerID")
+ .HasColumnType("int");
+
+ b.Property("DealerID")
+ .HasColumnType("int");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("OffertState")
+ .HasColumnType("int");
+
+ b.Property("RefNum")
+ .HasColumnType("int");
+
+ b.Property("RefRev")
+ .HasColumnType("int");
+
+ b.Property("RefYear")
+ .HasColumnType("int");
+
+ b.Property("ValidUntil")
+ .HasColumnType("datetime(6)");
+
+ b.HasKey("OfferID");
+
+ b.HasIndex("CustomerID");
+
+ b.HasIndex("DealerID");
+
+ b.ToTable("Offer");
+
+ b.HasData(
+ new
+ {
+ OfferID = 1,
+ CustomerID = 2,
+ DealerID = 2,
+ Description = "Offerta per tre serramenti",
+ Inserted = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8097),
+ Modified = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8099),
+ OffertState = 0,
+ RefNum = 1,
+ RefRev = 1,
+ RefYear = 2024,
+ ValidUntil = new DateTime(2025, 8, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8094)
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OfferRowModel", b =>
+ {
+ b.Property("OfferRowID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OfferRowID"));
+
+ b.Property("Cost")
+ .HasColumnType("double");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ItemSPP")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("OfferID")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.Property("RowNum")
+ .HasColumnType("int");
+
+ b.Property("SellingItemID")
+ .HasColumnType("int");
+
+ b.Property("SerStruct")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("OfferRowID");
+
+ b.HasIndex("OfferID");
+
+ b.HasIndex("SellingItemID");
+
+ b.ToTable("OfferRowList");
+
+ b.HasData(
+ new
+ {
+ OfferRowID = 1,
+ Cost = 950.0,
+ Inserted = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8123),
+ ItemSPP = "{}",
+ Modified = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8125),
+ Note = "Finestra anta singola 2025",
+ OfferID = 1,
+ Qty = 3.0,
+ RowNum = 1,
+ SellingItemID = 1,
+ SerStruct = "{}"
+ },
+ new
+ {
+ OfferRowID = 2,
+ Cost = 160.0,
+ Inserted = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8137),
+ ItemSPP = "{}",
+ Modified = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8138),
+ Note = "Persiana per Finestra anta singola 2025",
+ OfferID = 1,
+ Qty = 3.0,
+ RowNum = 1,
+ SellingItemID = 2,
+ SerStruct = "{}"
+ },
+ new
+ {
+ OfferRowID = 3,
+ Cost = 200.0,
+ Inserted = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8144),
+ ItemSPP = "{}",
+ Modified = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(8145),
+ Note = "Installazione serramento",
+ OfferID = 1,
+ Qty = 3.0,
+ RowNum = 1,
+ SellingItemID = 3,
+ SerStruct = "{}"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OrderModel", b =>
+ {
+ b.Property("OrderID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OrderID"));
+
+ b.Property("CustomerID")
+ .HasColumnType("int");
+
+ b.Property("DealerID")
+ .HasColumnType("int");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("OfferID")
+ .HasColumnType("int");
+
+ b.Property("OffertState")
+ .HasColumnType("int");
+
+ b.Property("RefNum")
+ .HasColumnType("int");
+
+ b.Property("RefRev")
+ .HasColumnType("int");
+
+ b.Property("RefYear")
+ .HasColumnType("int");
+
+ b.Property("ValidUntil")
+ .HasColumnType("datetime(6)");
+
+ b.HasKey("OrderID");
+
+ b.HasIndex("CustomerID");
+
+ b.HasIndex("DealerID");
+
+ b.HasIndex("OfferID");
+
+ b.ToTable("Order");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OrderRowModel", b =>
+ {
+ b.Property("OrderRowID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OrderRowID"));
+
+ b.Property("Cost")
+ .HasColumnType("double");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ItemSPP")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("OrderID")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.Property("RowNum")
+ .HasColumnType("int");
+
+ b.Property("SellingItemID")
+ .HasColumnType("int");
+
+ b.Property("SerStruct")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("OrderRowID");
+
+ b.HasIndex("OrderID");
+
+ b.HasIndex("SellingItemID");
+
+ b.ToTable("OrderRowList");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.PhaseModel", b =>
+ {
+ b.Property("PhaseID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("PhaseID"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("PhaseID");
+
+ b.ToTable("RegPhase");
+
+ b.HasData(
+ new
+ {
+ PhaseID = 1,
+ Description = "Taglio tronchetti"
+ },
+ new
+ {
+ PhaseID = 2,
+ Description = "Lavorazione pezzi serramento"
+ },
+ new
+ {
+ PhaseID = 3,
+ Description = "Verniciatura"
+ },
+ new
+ {
+ PhaseID = 4,
+ Description = "Assemblaggio completo"
+ },
+ new
+ {
+ PhaseID = 5,
+ Description = "Assemblaggio Ferramenta"
+ },
+ new
+ {
+ PhaseID = 6,
+ Description = "Installazione e posa in opera"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.ProductionBatchModel", b =>
+ {
+ b.Property("ProductionBatchID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProductionBatchID"));
+
+ b.Property("DateEnd")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("DueDate")
+ .HasColumnType("datetime(6)");
+
+ b.HasKey("ProductionBatchID");
+
+ b.ToTable("ProductionBatch");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.ProductionItemModel", b =>
+ {
+ b.Property("ProdItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProdItemID"));
+
+ b.Property("ExtItemCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ItemCode")
+ .HasColumnType("int");
+
+ b.Property("OrderRowID")
+ .HasColumnType("int");
+
+ b.Property("ProductionBatchID")
+ .HasColumnType("int");
+
+ b.HasKey("ProdItemID");
+
+ b.HasIndex("OrderRowID");
+
+ b.HasIndex("ProductionBatchID");
+
+ b.ToTable("ProductionItem");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.ProductionItemRowModel", b =>
+ {
+ b.Property("ProdItemRowID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProdItemRowID"));
+
+ b.Property("DateEnd")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Index")
+ .HasColumnType("int");
+
+ b.Property("PhaseID")
+ .HasColumnType("int");
+
+ b.Property("ProdItemID")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.Property("ResourceID")
+ .HasColumnType("int");
+
+ b.Property("WorkTime")
+ .HasColumnType("double");
+
+ b.HasKey("ProdItemRowID");
+
+ b.HasIndex("PhaseID");
+
+ b.HasIndex("ProdItemID");
+
+ b.HasIndex("ResourceID");
+
+ b.ToTable("ProductionItemRowList");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.ResourceModel", b =>
+ {
+ b.Property("ResourceID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResourceID"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("IsAsset")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsHuman")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("UmFix")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("UmProp")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("UnitCostFix")
+ .HasColumnType("double");
+
+ b.Property("UnitCostProp")
+ .HasColumnType("double");
+
+ b.HasKey("ResourceID");
+
+ b.ToTable("RegResource");
+
+ b.HasData(
+ new
+ {
+ ResourceID = 1,
+ Description = "Sezionatrice",
+ IsAsset = true,
+ IsHuman = false,
+ UmFix = "€/h",
+ UmProp = "",
+ UnitCostFix = 15.0,
+ UnitCostProp = 0.0
+ },
+ new
+ {
+ ResourceID = 2,
+ Description = "Linea SAOMAD WoodPecker Just 3500",
+ IsAsset = true,
+ IsHuman = false,
+ UmFix = "€/h",
+ UmProp = "€/m",
+ UnitCostFix = 540.0,
+ UnitCostProp = 1.8999999999999999
+ },
+ new
+ {
+ ResourceID = 3,
+ Description = "Linea Pantografo",
+ IsAsset = true,
+ IsHuman = false,
+ UmFix = "€/h",
+ UmProp = "",
+ UnitCostFix = 250.0,
+ UnitCostProp = 0.0
+ },
+ new
+ {
+ ResourceID = 4,
+ Description = "Stazione Verniciatura",
+ IsAsset = true,
+ IsHuman = false,
+ UmFix = "€/h",
+ UmProp = "€/m",
+ UnitCostFix = 10.0,
+ UnitCostProp = 1.8999999999999999
+ },
+ new
+ {
+ ResourceID = 5,
+ Description = "Verniciatura Manuale",
+ IsAsset = false,
+ IsHuman = true,
+ UmFix = "€/h",
+ UmProp = "€/m",
+ UnitCostFix = 40.0,
+ UnitCostProp = 1.8999999999999999
+ },
+ new
+ {
+ ResourceID = 6,
+ Description = "Montaggio Manuale",
+ IsAsset = false,
+ IsHuman = true,
+ UmFix = "",
+ UmProp = "€/h",
+ UnitCostFix = 0.0,
+ UnitCostProp = 40.0
+ },
+ new
+ {
+ ResourceID = 7,
+ Description = "Installatore",
+ IsAsset = false,
+ IsHuman = true,
+ UmFix = "",
+ UmProp = "€/h",
+ UnitCostFix = 0.0,
+ UnitCostProp = 40.0
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.SellingItemModel", b =>
+ {
+ b.Property("SellingItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SellingItemID"));
+
+ b.Property("Cost")
+ .HasColumnType("double");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ExtItemCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("IsService")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemCode")
+ .HasColumnType("int");
+
+ b.Property("ItemSPP")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("JobID")
+ .HasColumnType("int");
+
+ b.Property("Margin")
+ .HasColumnType("double");
+
+ b.Property("SerStruct")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("SupplCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("UM")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("SellingItemID");
+
+ b.HasIndex("JobID");
+
+ b.ToTable("SellingItem");
+
+ b.HasData(
+ new
+ {
+ SellingItemID = 1,
+ Cost = 820.0,
+ Description = "Finestra anta Singola",
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSPP = "",
+ JobID = 2,
+ Margin = 0.20000000000000001,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 2,
+ Cost = 150.0,
+ Description = "Persiana anta singola",
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSPP = "",
+ JobID = 1,
+ Margin = 0.10000000000000001,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 3,
+ Cost = 200.0,
+ Description = "Installazione",
+ ExtItemCode = "",
+ IsService = true,
+ ItemCode = 0,
+ ItemSPP = "",
+ JobID = 1,
+ Margin = 0.29999999999999999,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.StockMovModel", b =>
+ {
+ b.Property("StockMovID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StockMovID"));
+
+ b.Property("DtRec")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("QtyRec")
+ .HasColumnType("double");
+
+ b.Property("StockStatusId")
+ .HasColumnType("int");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("StockMovID");
+
+ b.HasIndex("StockStatusId");
+
+ b.ToTable("StockMov");
+
+ b.HasData(
+ new
+ {
+ StockMovID = 1,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7890),
+ Note = "DEMO",
+ QtyRec = 5.0,
+ StockStatusId = 1,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 2,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7895),
+ Note = "DEMO",
+ QtyRec = 8.0,
+ StockStatusId = 2,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 3,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7899),
+ Note = "DEMO",
+ QtyRec = 5.0,
+ StockStatusId = 3,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 4,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7903),
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 4,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 5,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7906),
+ Note = "DEMO",
+ QtyRec = 10.0,
+ StockStatusId = 5,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 6,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7910),
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 6,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 7,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7914),
+ Note = "DEMO",
+ QtyRec = 50.0,
+ StockStatusId = 7,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 8,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7917),
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 8,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 9,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7921),
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 9,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 10,
+ DtRec = new DateTime(2025, 7, 7, 18, 13, 5, 424, DateTimeKind.Local).AddTicks(7925),
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 10,
+ UserId = "samuele.locatelli@egalware.com"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.StockStatusModel", b =>
+ {
+ b.Property("StockStatusId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StockStatusId"));
+
+ b.Property("IsDeleted")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsRemn")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemID")
+ .HasColumnType("int");
+
+ b.Property("Location")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("QtyAvail")
+ .HasColumnType("double");
+
+ b.HasKey("StockStatusId");
+
+ b.HasIndex("ItemID");
+
+ b.ToTable("StockStatus");
+
+ b.HasData(
+ new
+ {
+ StockStatusId = 1,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 1,
+ Location = "B001-001-003",
+ QtyAvail = 5.0
+ },
+ new
+ {
+ StockStatusId = 2,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 2,
+ Location = "B001-001-002",
+ QtyAvail = 8.0
+ },
+ new
+ {
+ StockStatusId = 3,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 3,
+ Location = "B001-001-001",
+ QtyAvail = 5.0
+ },
+ new
+ {
+ StockStatusId = 4,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 4,
+ Location = "V002-001-001",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 5,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 5,
+ Location = "V001-001-002",
+ QtyAvail = 10.0
+ },
+ new
+ {
+ StockStatusId = 6,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 6,
+ Location = "V001-001-003",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 7,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 7,
+ Location = "V001-001-003",
+ QtyAvail = 50.0
+ },
+ new
+ {
+ StockStatusId = 8,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 8,
+ Location = "S001-002-001",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 9,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 9,
+ Location = "S001-002-001",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 10,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 10,
+ Location = "S001-001-001",
+ QtyAvail = 1.0
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.SupplierModel", b =>
+ {
+ b.Property("SupplierID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SupplierID"));
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("SupplierID");
+
+ b.ToTable("RegSupplier");
+
+ b.HasData(
+ new
+ {
+ SupplierID = 1,
+ CompanyName = "Company One",
+ FirstName = "Supplier A",
+ LastName = "Egalware",
+ VAT = "7294857103879254"
+ },
+ new
+ {
+ SupplierID = 2,
+ CompanyName = "Company Two",
+ FirstName = "Supplier B",
+ LastName = "User",
+ VAT = "7294857103879254"
+ },
+ new
+ {
+ SupplierID = 3,
+ CompanyName = "Company Two",
+ FirstName = "Supplier C",
+ LastName = "User Test",
+ VAT = "7294857103879254"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.TagsModel", b =>
+ {
+ b.Property("TagID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TagID"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("TagID");
+
+ b.ToTable("RegTags");
+
+ b.HasData(
+ new
+ {
+ TagID = 1,
+ Description = "Tag 01"
+ },
+ new
+ {
+ TagID = 2,
+ Description = "Tag 02"
+ },
+ new
+ {
+ TagID = 3,
+ Description = "Tag 03"
+ },
+ new
+ {
+ TagID = 4,
+ Description = "Tag 04"
+ },
+ new
+ {
+ TagID = 5,
+ Description = "Tag 05"
+ });
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.JobRowItemModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.ItemModel", "ItemNav")
+ .WithMany()
+ .HasForeignKey("ItemID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.JobRowModel", "JobRowNav")
+ .WithMany()
+ .HasForeignKey("JobRowID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("ItemNav");
+
+ b.Navigation("JobRowNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.JobRowModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.JobModel", "JobNav")
+ .WithMany()
+ .HasForeignKey("JobID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.PhaseModel", "PhaseNav")
+ .WithMany()
+ .HasForeignKey("PhaseID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.ResourceModel", "ResourceNav")
+ .WithMany()
+ .HasForeignKey("ResourceID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("JobNav");
+
+ b.Navigation("PhaseNav");
+
+ b.Navigation("ResourceNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OfferModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.CustomerModel", "CustomerNav")
+ .WithMany()
+ .HasForeignKey("CustomerID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.DealerModel", "DealerNav")
+ .WithMany()
+ .HasForeignKey("DealerID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("CustomerNav");
+
+ b.Navigation("DealerNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OfferRowModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.OfferModel", "OfferNav")
+ .WithMany()
+ .HasForeignKey("OfferID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.SellingItemModel", "SellingItemNav")
+ .WithMany()
+ .HasForeignKey("SellingItemID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("OfferNav");
+
+ b.Navigation("SellingItemNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OrderModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.CustomerModel", "CustomerNav")
+ .WithMany()
+ .HasForeignKey("CustomerID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.DealerModel", "DealerNav")
+ .WithMany()
+ .HasForeignKey("DealerID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.OfferModel", "OfferNav")
+ .WithMany()
+ .HasForeignKey("OfferID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("CustomerNav");
+
+ b.Navigation("DealerNav");
+
+ b.Navigation("OfferNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.OrderRowModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.OrderModel", "OrderNav")
+ .WithMany()
+ .HasForeignKey("OrderID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.SellingItemModel", "SellingItemNav")
+ .WithMany()
+ .HasForeignKey("SellingItemID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("OrderNav");
+
+ b.Navigation("SellingItemNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.ProductionItemModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.OrderRowModel", "OrderRowNav")
+ .WithMany()
+ .HasForeignKey("OrderRowID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.ProductionBatchModel", "ProductionBatchNav")
+ .WithMany()
+ .HasForeignKey("ProductionBatchID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("OrderRowNav");
+
+ b.Navigation("ProductionBatchNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.ProductionItemRowModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.PhaseModel", "PhaseNav")
+ .WithMany()
+ .HasForeignKey("PhaseID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.ProductionItemModel", "ProdItemNav")
+ .WithMany()
+ .HasForeignKey("ProdItemID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Lux.Data.DbModel.ResourceModel", "ResourceNav")
+ .WithMany()
+ .HasForeignKey("ResourceID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("PhaseNav");
+
+ b.Navigation("ProdItemNav");
+
+ b.Navigation("ResourceNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.SellingItemModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.JobModel", "JobNav")
+ .WithMany()
+ .HasForeignKey("JobID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("JobNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.StockMovModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.StockStatusModel", "StockStatusNav")
+ .WithMany()
+ .HasForeignKey("StockStatusId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("StockStatusNav");
+ });
+
+ modelBuilder.Entity("Lux.Data.DbModel.StockStatusModel", b =>
+ {
+ b.HasOne("Lux.Data.DbModel.ItemModel", "ItemNav")
+ .WithMany()
+ .HasForeignKey("ItemID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("ItemNav");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Lux.Data/Migrations/20250707161305_InitDb.cs b/Lux.Data/Migrations/20250707161305_InitDb.cs
new file mode 100644
index 00000000..3c89208e
--- /dev/null
+++ b/Lux.Data/Migrations/20250707161305_InitDb.cs
@@ -0,0 +1,929 @@
+using System;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
+
+namespace Lux.Data.Migrations
+{
+ ///
+ public partial class InitDb : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterDatabase()
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "JobList",
+ 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")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_JobList", x => x.JobID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "ProductionBatch",
+ columns: table => new
+ {
+ ProductionBatchID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ Description = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ DueDate = table.Column(type: "datetime(6)", nullable: false),
+ DateStart = table.Column(type: "datetime(6)", nullable: true),
+ DateEnd = table.Column(type: "datetime(6)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ProductionBatch", x => x.ProductionBatchID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "RegCustomer",
+ columns: table => new
+ {
+ CustomerID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CompanyName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ FirstName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ LastName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ VAT = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RegCustomer", x => x.CustomerID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "RegDealer",
+ columns: table => new
+ {
+ DealerID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CompanyName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ FirstName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ LastName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ VAT = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RegDealer", x => x.DealerID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "RegItem",
+ columns: table => new
+ {
+ ItemID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ IsService = table.Column(type: "tinyint(1)", 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")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RegItem", x => x.ItemID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "RegPhase",
+ columns: table => new
+ {
+ PhaseID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ Description = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RegPhase", x => x.PhaseID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "RegResource",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ Description = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ IsAsset = table.Column(type: "tinyint(1)", nullable: false),
+ IsHuman = table.Column(type: "tinyint(1)", nullable: false),
+ UnitCostFix = table.Column(type: "double", nullable: false),
+ UmFix = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ UnitCostProp = table.Column(type: "double", nullable: false),
+ UmProp = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RegResource", x => x.ResourceID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "RegSupplier",
+ columns: table => new
+ {
+ SupplierID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CompanyName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ FirstName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ LastName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ VAT = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RegSupplier", x => x.SupplierID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "RegTags",
+ columns: table => new
+ {
+ TagID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ Description = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RegTags", x => x.TagID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "SellingItem",
+ columns: table => new
+ {
+ SellingItemID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ 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"),
+ ItemSPP = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_SellingItem", x => x.SellingItemID);
+ table.ForeignKey(
+ name: "FK_SellingItem_JobList_JobID",
+ column: x => x.JobID,
+ principalTable: "JobList",
+ principalColumn: "JobID",
+ onDelete: ReferentialAction.Restrict);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "Offer",
+ columns: table => new
+ {
+ OfferID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ RefYear = table.Column(type: "int", nullable: false),
+ RefNum = table.Column(type: "int", nullable: false),
+ RefRev = table.Column(type: "int", nullable: false),
+ Description = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ CustomerID = table.Column(type: "int", nullable: false),
+ DealerID = table.Column(type: "int", nullable: false),
+ ValidUntil = table.Column(type: "datetime(6)", nullable: false),
+ Inserted = table.Column(type: "datetime(6)", nullable: false),
+ Modified = table.Column(type: "datetime(6)", nullable: false),
+ OffertState = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Offer", x => x.OfferID);
+ table.ForeignKey(
+ name: "FK_Offer_RegCustomer_CustomerID",
+ column: x => x.CustomerID,
+ principalTable: "RegCustomer",
+ principalColumn: "CustomerID",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Offer_RegDealer_DealerID",
+ column: x => x.DealerID,
+ principalTable: "RegDealer",
+ principalColumn: "DealerID",
+ onDelete: ReferentialAction.Restrict);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "StockStatus",
+ columns: table => new
+ {
+ StockStatusId = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ ItemID = table.Column(type: "int", nullable: false),
+ QtyAvail = table.Column(type: "double", nullable: false),
+ IsDeleted = table.Column(type: "tinyint(1)", nullable: false),
+ IsRemn = table.Column(type: "tinyint(1)", nullable: false),
+ Location = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_StockStatus", x => x.StockStatusId);
+ table.ForeignKey(
+ name: "FK_StockStatus_RegItem_ItemID",
+ column: x => x.ItemID,
+ principalTable: "RegItem",
+ principalColumn: "ItemID",
+ onDelete: ReferentialAction.Restrict);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "JobRowList",
+ columns: table => new
+ {
+ JobRowID = 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"),
+ Qty = table.Column(type: "double", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_JobRowList", x => x.JobRowID);
+ table.ForeignKey(
+ name: "FK_JobRowList_JobList_JobID",
+ column: x => x.JobID,
+ principalTable: "JobList",
+ principalColumn: "JobID",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_JobRowList_RegPhase_PhaseID",
+ column: x => x.PhaseID,
+ principalTable: "RegPhase",
+ principalColumn: "PhaseID",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_JobRowList_RegResource_ResourceID",
+ column: x => x.ResourceID,
+ principalTable: "RegResource",
+ principalColumn: "ResourceID",
+ onDelete: ReferentialAction.Restrict);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "OfferRowList",
+ columns: table => new
+ {
+ OfferRowID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ OfferID = table.Column(type: "int", nullable: false),
+ RowNum = table.Column(type: "int", nullable: false),
+ SellingItemID = table.Column(type: "int", nullable: false),
+ Cost = table.Column(type: "double", nullable: false),
+ Qty = table.Column(type: "double", nullable: false),
+ SerStruct = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ItemSPP = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Note = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Inserted = table.Column(type: "datetime(6)", nullable: false),
+ Modified = table.Column(type: "datetime(6)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_OfferRowList", x => x.OfferRowID);
+ table.ForeignKey(
+ name: "FK_OfferRowList_Offer_OfferID",
+ column: x => x.OfferID,
+ principalTable: "Offer",
+ principalColumn: "OfferID",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_OfferRowList_SellingItem_SellingItemID",
+ column: x => x.SellingItemID,
+ principalTable: "SellingItem",
+ principalColumn: "SellingItemID",
+ onDelete: ReferentialAction.Restrict);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "Order",
+ columns: table => new
+ {
+ OrderID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ OfferID = table.Column(type: "int", nullable: false),
+ RefYear = table.Column(type: "int", nullable: false),
+ RefNum = table.Column(type: "int", nullable: false),
+ RefRev = table.Column