diff --git a/WebDoorCreator.API/Controllers/OrderController.cs b/WebDoorCreator.API/Controllers/OrderController.cs
index d6771da..1de7526 100644
--- a/WebDoorCreator.API/Controllers/OrderController.cs
+++ b/WebDoorCreator.API/Controllers/OrderController.cs
@@ -28,7 +28,7 @@ namespace WebDoorCreator.API.Controllers
}
///
/// GET: api/Order/GetCurrent
- /// Recupera ordini degli ultimi 6 mesi dato cliente e stato
+ /// Recupera ordini dato id cliente + stato ordini (limitato a ultimi 6 mesi)
///
///
[HttpGet("GetCurrent")]
@@ -36,7 +36,7 @@ namespace WebDoorCreator.API.Controllers
{
List answ = new List();
DateTime dtEnd = DateTime.Now;
- DateTime dtStart = dtEnd.AddMonths(-1);
+ DateTime dtStart = dtEnd.AddMonths(-6);
var rawData = await WDCService.OrderStatusGetFilt(id, ordStatus, dtStart, dtEnd);
if (rawData != null)
{
@@ -49,8 +49,8 @@ namespace WebDoorCreator.API.Controllers
///
///
///
- [HttpGet("OrderDetail")]
- public async Task OrderDetail(int OrderId)
+ [HttpGet("GetDetail")]
+ public async Task GetDetail(int OrderId)
{
OrderDetailsDTO answ = new OrderDetailsDTO()
{
@@ -58,19 +58,81 @@ namespace WebDoorCreator.API.Controllers
};
// recupero info ordine
var rawOrder = await WDCService.OrderGetByKey(OrderId);
- if (rawOrder != null)
+ if (rawOrder != null && rawOrder.CompanyNav != null)
{
answ.OrderDescript = rawOrder.OrderDescript;
answ.OrderExtCode = rawOrder.OrderExtCode;
- // recupero info customer
+ // recupero info customer
+ CustomerDTO customer = new CustomerDTO()
+ {
+ Address = rawOrder.CompanyNav.Address,
+ City = rawOrder.CompanyNav.City,
+ CompanyExtCode = rawOrder.CompanyNav.CompanyExtCode,
+ CompanyId = rawOrder.CompanyNav.CompanyId,
+ CompanyName = rawOrder.CompanyNav.CompanyName,
+ State = rawOrder.CompanyNav.State,
+ VAT = rawOrder.CompanyNav.VAT,
+ ZipCode = rawOrder.CompanyNav.ZipCode
+ };
+ answ.CustomerInfo = customer;
// recuper elenco porte...
+ List dcDTO = new List();
+ var doorsList = await WDCService.DoorGetByOrderId(OrderId);
+ foreach (var door in doorsList)
+ {
+ // recupero i dato DoorOp
+ var doorOpList = await WDCService.DoorOpGetByDoorId(door.DoorId);
+ Dictionary> currBOMList = new Dictionary>();
+ // ciclo su tutte le DoorOp
+ foreach (var doorOp in doorOpList)
+ {
+ // cerco se ci sia già o meno nella BOM l'item corrente
+ if (currBOMList.ContainsKey(doorOp.ObjectId))
+ {
+ currBOMList[doorOp.ObjectId].Add(doorOp.JsoncActVal);
+ }
+ else
+ {
+ List currOp = new List();
+ currOp.Add(doorOp.JsoncActVal);
+ currBOMList.Add(doorOp.ObjectId, currOp);
+ }
+ }
+ // creo oggetto DTO finale della porta
+ var doorDto = new DoorCostingDTO()
+ {
+ DoorId = door.DoorId,
+ Quantity = door.Quantity,
+ EstimatedWorkTime = 0,
+ BOMList = currBOMList
+ };
+ dcDTO.Add(doorDto);
+ }
//answ. = rawOrder.OrderDescript;
+ answ.DoorsList = dcDTO;
}
// popolo con dati specifica...
return answ;
}
+ ///
+ /// Door price update for order's cost evaluation
+ ///
+ /// list of DoorPriceDTO with UnitPrices
+ ///
+ [HttpPost("DoorPriceUpdate")]
+ public async Task DoorPriceUpdate(List EvalResults)
+ {
+ string answ = "NA";
+ var updateSet = EvalResults
+ .Where(x => x.Valid)
+ .ToDictionary(x => x.DoorId, x => x.UnitCost);
+ bool fatto = await WDCService.DoorUpdateCosts(updateSet);
+ answ = fatto ? "OK" : "NO";
+ return answ;
+ }
+
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
diff --git a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs
index 9fd49d8..e7380ac 100644
--- a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs
+++ b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs
@@ -639,6 +639,43 @@ namespace WebDoorCreator.Data.Controllers
return dbResult;
}
+ ///
+ /// Update costing for dictionary of doors
+ ///
+ ///
+ ///
+ public async Task DoorUpdateCosts(Dictionary DoorUnitCosts)
+ {
+ bool fatto = false;
+ using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
+ {
+ try
+ {
+ // ciclo x ogni porta...
+
+ foreach (var item in DoorUnitCosts)
+ {
+ var currRec = localDbCtx
+ .DbSetDoor
+ .Where(x => x.DoorId == item.Key)
+ .FirstOrDefault();
+ if (currRec != null) //if is not null edit the record found
+ {
+ currRec.UnitCost = item.Value;
+ localDbCtx.Entry(currRec).State = EntityState.Modified;
+ }
+ }
+ await localDbCtx.SaveChangesAsync();
+ fatto = true;
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione durante DoorUpdateCosts: {Environment.NewLine}{exc}");
+ }
+ }
+ return fatto;
+ }
+
///
/// Modifying or adding a new door
///
@@ -659,8 +696,8 @@ namespace WebDoorCreator.Data.Controllers
if (currRec != null) //if is not null edit the record found
{
currRec.Quantity = addEditRec.Quantity;
- currRec.DoorExtCode= addEditRec.DoorExtCode;
- currRec.DoorDescript= addEditRec.DoorDescript;
+ currRec.DoorExtCode = addEditRec.DoorExtCode;
+ currRec.DoorDescript = addEditRec.DoorDescript;
currRec.DoorIdParent = addEditRec.DoorIdParent;
localDbCtx.Entry(currRec).State = EntityState.Modified;
}
@@ -706,7 +743,7 @@ namespace WebDoorCreator.Data.Controllers
}
///
- /// Adding a new list value
+ /// Adding new list value set
///
/// Record to add
///
@@ -729,14 +766,12 @@ namespace WebDoorCreator.Data.Controllers
.AddRange(addList);
await localDbCtx.SaveChangesAsync();
- // stored di merge dati in vocabolario
+ // stored di merge dati in ListVal
storedRes = localDbCtx
.Database
.ExecuteSqlRaw("exec dbo.stp_ListVal_Import");
fatto = true;
-
- fatto = true;
}
catch (Exception exc)
{
@@ -746,6 +781,45 @@ namespace WebDoorCreator.Data.Controllers
return fatto;
}
+ ///
+ /// Adding new DoorOpType data
+ ///
+ /// Record to add
+ ///
+ public async Task DoorOpTypeAdd(List addList)
+ {
+ bool fatto = false;
+ using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
+ {
+ try
+ {
+ // stored di reset ListValues
+ var storedRes = localDbCtx
+ .Database
+ .ExecuteSqlRaw("exec dbo.stp_DoorOpType_Prepare");
+ await localDbCtx.SaveChangesAsync();
+
+ // import massivo dati in tab temp
+ localDbCtx
+ .DbSetDoorOpTypeTemp
+ .AddRange(addList);
+ await localDbCtx.SaveChangesAsync();
+
+ // stored di merge dati in DoorOpType
+ storedRes = localDbCtx
+ .Database
+ .ExecuteSqlRaw("exec dbo.stp_DoorOpType_Import");
+
+ fatto = true;
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione durante DoorOpTypeAdd: {Environment.NewLine}{exc}");
+ }
+ }
+ return fatto;
+ }
+
///
/// ListValues list (All)
///
@@ -887,6 +961,7 @@ namespace WebDoorCreator.Data.Controllers
var rawData = dbCtx
.DbSetOrders
.Where(x => x.OrderId == orderId)
+ .Include(c => c.CompanyNav)
.AsNoTracking()
.FirstOrDefault();
if (rawData != null)
diff --git a/WebDoorCreator.Data/DTO/CalcResultDTO.cs b/WebDoorCreator.Data/DTO/CalcResultDTO.cs
index 6679dc8..2a3dc41 100644
--- a/WebDoorCreator.Data/DTO/CalcResultDTO.cs
+++ b/WebDoorCreator.Data/DTO/CalcResultDTO.cs
@@ -28,7 +28,7 @@ namespace WebDoorCreator.Data.DTO
///
public string SvgGen { get; set; } = "";
///
- /// Articat path (ex 3d zip/pack)
+ /// Artifats path (ex 3d zip/pack)
///
public string artifactPath { get; set; } = "";
}
diff --git a/WebDoorCreator.Data/DTO/DoorCostingDTO.cs b/WebDoorCreator.Data/DTO/DoorCostingDTO.cs
index d9b3475..9851c99 100644
--- a/WebDoorCreator.Data/DTO/DoorCostingDTO.cs
+++ b/WebDoorCreator.Data/DTO/DoorCostingDTO.cs
@@ -13,13 +13,10 @@ namespace WebDoorCreator.Data.DTO
public class DoorCostingDTO
{
public int DoorId { get; set; } = 0;
-
- public double SizeX { get; set; } = 0;
- public double SizeY { get; set; } = 0;
- public double SizeZ { get; set; } = 0;
+ public int Quantity { get; set; } = 1;
public double EstimatedWorkTime { get; set; } = 0;
- public Dictionary BOMList { get; set; }= new Dictionary();
+ public Dictionary> BOMList { get; set; }= new Dictionary>();
}
}
diff --git a/WebDoorCreator.Data/DTO/DoorPriceDTO.cs b/WebDoorCreator.Data/DTO/DoorPriceDTO.cs
new file mode 100644
index 0000000..0321a5f
--- /dev/null
+++ b/WebDoorCreator.Data/DTO/DoorPriceDTO.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebDoorCreator.Data.DTO
+{
+ ///
+ /// Door cost data DTO
+ ///
+ public class DoorPriceDTO
+ {
+ ///
+ /// Door UID
+ ///
+ public int OrderId { get; set; } = 0;
+ ///
+ /// Door UID
+ ///
+ public int DoorId { get; set; } = 0;
+ ///
+ /// Articat path (ex 3d zip/pack)
+ ///
+ public decimal UnitCost { get; set; } = 0;
+ ///
+ /// Valid = true / cannot deliver = false
+ ///
+ public bool Valid { get; set; } = true;
+ ///
+ /// Error message (optional)
+ ///
+ public string ErrorMsg { get; set; } = "";
+ }
+}
diff --git a/WebDoorCreator.Data/DbModels/DoorOpTypeModel.cs b/WebDoorCreator.Data/DbModels/DoorOpTypeModel.cs
index 0230181..f9d0081 100644
--- a/WebDoorCreator.Data/DbModels/DoorOpTypeModel.cs
+++ b/WebDoorCreator.Data/DbModels/DoorOpTypeModel.cs
@@ -72,16 +72,20 @@ namespace WebDoorCreator.Data.DbModels
///
public int ParentDoorOpId { get; set; } = 0;
- ///
- /// Idx univoco dell'elemento parent (se 0 = root)
- ///
- public HierarchyId? DoorOpIdPathFromPatriarch { get; set; }
-
+ /////
+ ///// Idx univoco dell'elemento parent (se 0 = root)
+ /////
+ //public HierarchyId? DoorOpIdPathFromPatriarch { get; set; }
///
- /// Oggetto Json per specifica configurazione (template)
+ /// Unit cost for the door
///
- public string JsoncConfig { get; set; } = "";
+ public decimal UnitCost { get; set; } = 0;
+
+ /////
+ ///// Oggetto Json per specifica configurazione (template)
+ /////
+ //public string JsoncConfig { get; set; } = "";
///
/// Codice esterno (opzionale)
diff --git a/WebDoorCreator.Data/DbModels/DoorOpTypeTempModel.cs b/WebDoorCreator.Data/DbModels/DoorOpTypeTempModel.cs
new file mode 100644
index 0000000..1804314
--- /dev/null
+++ b/WebDoorCreator.Data/DbModels/DoorOpTypeTempModel.cs
@@ -0,0 +1,129 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+
+//
+// This is here so CodeMaid doesn't reorganize this document
+//
+namespace WebDoorCreator.Data.DbModels
+{
+ ///
+ /// Tabella dati Door Operation Type (astratte) TEMP
+ ///
+ [Table("DoorOpTypeTemp")]
+ public class DoorOpTypeTempModel
+ {
+ [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int DoorOpTypId { get; set; }
+
+ ///
+ /// Codice univoco dell'operazione da svolgere (calcolato, idealmente 4 char da 36 val 0..Z)
+ ///
+ public string OpCode { get; set; } = "";
+
+ ///
+ /// Descrizione
+ ///
+ public string Description { get; set; } = "";
+
+ ///
+ /// Indica se sia da creare sempre
+ ///
+ public bool IsDefault { get; set; } = false;
+
+ ///
+ /// Indica se ci sia un hardware correlato all'operazione
+ ///
+ public bool HasHw { get; set; } = true;
+
+ ///
+ /// Indica se sia un oggetto concreto (= con un file, che si può produrre) o abstract (ha figli, è un gruppo logico)
+ ///
+ public bool IsConcrete { get; set; } = true;
+
+ ///
+ /// Codice dell'HW collegato
+ ///
+ public string HwCode { get; set; } = "";
+
+ ///
+ /// Descrizione dell'HW collegato
+ ///
+ public string HwDescription { get; set; } = "";
+
+
+ ///
+ /// URL dell'immagine/link di riferimento
+ ///
+ public string DisplayUrl { get; set; } = "";
+
+ ///
+ /// Path folder/file di riferimento
+ ///
+ public string FPath { get; set; } = "";
+
+ ///
+ /// Idx univoco dell'elemento parent (se 0 = root)
+ ///
+ public int ParentDoorOpId { get; set; } = 0;
+
+ /////
+ ///// Idx univoco dell'elemento parent (se 0 = root)
+ /////
+ //public HierarchyId? DoorOpIdPathFromPatriarch { get; set; }
+
+ ///
+ /// Unit cost for the door
+ ///
+ public decimal UnitCost { get; set; } = 0;
+
+ /////
+ ///// Oggetto Json per specifica configurazione (template)
+ /////
+ //public string JsoncConfig { get; set; } = "";
+
+ ///
+ /// Codice esterno (opzionale)
+ ///
+ public string ExtOpCode { get; set; } = "";
+
+ ///
+ /// Descrizione esterna (opzionale)
+ ///
+ public string ExtDescript { get; set; } = "";
+
+ ///
+ /// Revisione dell'item
+ ///
+ public string Rev { get; set; } = "";
+
+ ///
+ /// Inizio validità item
+ ///
+ public DateTime ValidFrom { get; set; } = new DateTime(2000, 1, 1);
+
+ ///
+ /// Fine validità item
+ ///
+ public DateTime ValidUntil { get; set; } = new DateTime(3000, 1, 1);
+
+ ///
+ /// Check validità item
+ ///
+ [NotMapped]
+ public bool IsActive
+ {
+ get => DateTime.Today >= ValidFrom && DateTime.Today <= ValidUntil;
+ }
+
+ ///
+ /// Numero massimo associabile a singola Door
+ ///
+ public int MaxAllowed { get; set; } = 1;
+ }
+}
diff --git a/WebDoorCreator.Data/Migrations/WDCData/20230605134244_DoorOpTypeUpdate.Designer.cs b/WebDoorCreator.Data/Migrations/WDCData/20230605134244_DoorOpTypeUpdate.Designer.cs
new file mode 100644
index 0000000..06953c4
--- /dev/null
+++ b/WebDoorCreator.Data/Migrations/WDCData/20230605134244_DoorOpTypeUpdate.Designer.cs
@@ -0,0 +1,982 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using WebDoorCreator.Data;
+
+#nullable disable
+
+namespace WebDoorCreator.Data.Migrations.WDCData
+{
+ [DbContext(typeof(WDCDataContext))]
+ [Migration("20230605134244_DoorOpTypeUpdate")]
+ partial class DoorOpTypeUpdate
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .UseCollation("Latin1_General_CI_AS")
+ .HasAnnotation("ProductVersion", "6.0.14")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetRoles", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ConcurrencyStamp")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("AspNetRoles", null, t => t.ExcludeFromMigrations());
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("RoleId")
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", null, t => t.ExcludeFromMigrations());
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUsers", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("bit");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("NormalizedEmail")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NormalizedUserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PasswordHash")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("SecurityStamp")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("bit");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("AspNetUsers", null, t => t.ExcludeFromMigrations());
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.CompanyModel", b =>
+ {
+ b.Property("CompanyId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CompanyId"), 1L, 1);
+
+ b.Property("Address")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("nvarchar(250)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("CompanyExtCode")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("nvarchar(250)");
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("CompanyToken")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("nvarchar(150)");
+
+ b.Property("PrivateNote")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("State")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ZipCode")
+ .HasColumnType("int");
+
+ b.HasKey("CompanyId");
+
+ b.ToTable("Company");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.ConfigModel", b =>
+ {
+ b.Property("chiave")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("note")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("valore")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("valoreStd")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("chiave");
+
+ b.ToTable("Config");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
+ {
+ b.Property("DoorId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DoorId"), 1L, 1);
+
+ b.Property("DateIns")
+ .HasColumnType("datetime2");
+
+ b.Property("DateLockExpiry")
+ .HasColumnType("datetime2");
+
+ b.Property("DateMod")
+ .HasColumnType("datetime2");
+
+ b.Property("DoorDescript")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DoorExtCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DoorIdParent")
+ .HasColumnType("int");
+
+ b.Property("MeasureUnit")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderId")
+ .HasColumnType("int");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("UnitCost")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("UserIdIns")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserIdLock")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserIdMod")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("DoorId");
+
+ b.HasIndex("OrderId");
+
+ b.ToTable("Door");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpModel", b =>
+ {
+ b.Property("DoorOpId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DoorOpId"), 1L, 1);
+
+ b.Property("DateIns")
+ .HasColumnType("datetime2");
+
+ b.Property("DateMod")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DoorId")
+ .HasColumnType("int");
+
+ b.Property("DtConfirm")
+ .HasColumnType("datetime2");
+
+ b.Property("JsoncActVal")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("JsoncConfigVal")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ObjectId")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserIdIns")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserIdMod")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("userConfirm")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("DoorOpId");
+
+ b.HasIndex("DoorId");
+
+ b.ToTable("DoorOp");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpTypeModel", b =>
+ {
+ b.Property("DoorOpTypId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DoorOpTypId"), 1L, 1);
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DisplayUrl")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtDescript")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtOpCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FPath")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("HasHw")
+ .HasColumnType("bit");
+
+ b.Property("HwCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("HwDescription")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsConcrete")
+ .HasColumnType("bit");
+
+ b.Property("IsDefault")
+ .HasColumnType("bit");
+
+ b.Property("MaxAllowed")
+ .HasColumnType("int");
+
+ b.Property("OpCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ParentDoorOpId")
+ .HasColumnType("int");
+
+ b.Property("Rev")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UnitCost")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ValidFrom")
+ .HasColumnType("datetime2");
+
+ b.Property("ValidUntil")
+ .HasColumnType("datetime2");
+
+ b.HasKey("DoorOpTypId");
+
+ b.ToTable("DoorOpType");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.GraphicParamsModel", b =>
+ {
+ b.Property("GraphicParamId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("GraphicParamId"), 1L, 1);
+
+ b.Property("compoId")
+ .HasColumnType("int");
+
+ b.Property("graphicParamAlias")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("graphicParamDefaultVal")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("graphicParamKey")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("graphicParamName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("graphicParamType")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("graphicParamsN")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("GraphicParamId");
+
+ b.ToTable("GraphicParams");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.HardwareModel", b =>
+ {
+ b.Property("HardwareId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("HardwareId"), 1L, 1);
+
+ b.Property("compoAlias")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("compoLayerName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("compoName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("compoTemplateIsActive")
+ .HasColumnType("bit");
+
+ b.HasKey("HardwareId");
+
+ b.ToTable("Hardware");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.LanguageModel", b =>
+ {
+ b.Property("CodLingua")
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("DescrizioneLingua")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("CodLingua");
+
+ b.ToTable("Languages");
+
+ b.HasData(
+ new
+ {
+ CodLingua = "EN",
+ DescrizioneLingua = "English"
+ },
+ new
+ {
+ CodLingua = "IT",
+ DescrizioneLingua = "Italiano"
+ });
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValuesModel", b =>
+ {
+ b.Property("TableName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("FieldName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Value")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("DefaultVal")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("InputType")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Label")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Ordinal")
+ .HasColumnType("int");
+
+ b.Property("isSerializable")
+ .HasMaxLength(5)
+ .HasColumnType("bit");
+
+ b.HasKey("TableName", "FieldName", "Value");
+
+ b.ToTable("ListValues");
+
+ b.HasData(
+ new
+ {
+ TableName = "Opening",
+ FieldName = "Swing",
+ Value = "LH",
+ Label = "Left Handed",
+ Ordinal = 1,
+ isSerializable = false
+ },
+ new
+ {
+ TableName = "Opening",
+ FieldName = "Swing",
+ Value = "RH",
+ Label = "Right Handed",
+ Ordinal = 2,
+ isSerializable = false
+ },
+ new
+ {
+ TableName = "Opening",
+ FieldName = "Swing",
+ Value = "LHR",
+ Label = "Left Handed Reverse",
+ Ordinal = 3,
+ isSerializable = false
+ },
+ new
+ {
+ TableName = "Opening",
+ FieldName = "Swing",
+ Value = "RHR",
+ Label = "Right Handed Reverse",
+ Ordinal = 4,
+ isSerializable = false
+ },
+ new
+ {
+ TableName = "Edges",
+ FieldName = "EdgeType",
+ Value = "BV",
+ Label = "Bevel",
+ Ordinal = 1,
+ isSerializable = false
+ },
+ new
+ {
+ TableName = "Edges",
+ FieldName = "EdgeType",
+ Value = "SQ",
+ Label = "Squared",
+ Ordinal = 2,
+ isSerializable = false
+ },
+ new
+ {
+ TableName = "Edges",
+ FieldName = "EdgeType",
+ Value = "1B",
+ Label = "Bull Nose 1",
+ Ordinal = 3,
+ isSerializable = false
+ });
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValuesTempModel", b =>
+ {
+ b.Property("TableName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("FieldName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Value")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("DefaultVal")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("InputType")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Label")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Ordinal")
+ .HasColumnType("int");
+
+ b.Property("isSerializable")
+ .HasMaxLength(5)
+ .HasColumnType("bit");
+
+ b.HasKey("TableName", "FieldName", "Value");
+
+ b.ToTable("ListValuesTemp");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
+ {
+ b.Property("OrderId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("OrderId"), 1L, 1);
+
+ b.Property("CompanyId")
+ .HasColumnType("int");
+
+ b.Property("DateDelivery")
+ .HasColumnType("datetime2");
+
+ b.Property("DateIns")
+ .HasColumnType("datetime2");
+
+ b.Property("DateMod")
+ .HasColumnType("datetime2");
+
+ b.Property("Discount")
+ .HasColumnType("float");
+
+ b.Property("OrderDescript")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderExtCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("UserIdIns")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserIdMod")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("OrderId");
+
+ b.HasIndex("CompanyId");
+
+ b.ToTable("Order");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderStatusViewModel", b =>
+ {
+ b.Property("OrderId")
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("OrderId"), 1L, 1);
+
+ b.Property("CompanyId")
+ .HasColumnType("int");
+
+ b.Property("DateDelivery")
+ .HasColumnType("datetime2");
+
+ b.Property("DateIns")
+ .HasColumnType("datetime2");
+
+ b.Property("Discount")
+ .HasColumnType("float");
+
+ b.Property("NumDoors")
+ .HasColumnType("int");
+
+ b.Property("NumType")
+ .HasColumnType("int");
+
+ b.Property("OrderDescript")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderExtCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderStatus")
+ .HasColumnType("int");
+
+ b.Property("TotCost")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("UserIdIns")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserIdMod")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("OrderId");
+
+ b.ToView("v_OrderStatus");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.PrtRepOrderModel", b =>
+ {
+ b.Property("OrderId")
+ .HasColumnType("int");
+
+ b.Property("DoorId")
+ .HasColumnType("int");
+
+ b.Property("ObjectKey")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Address")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CompanyExtCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CompanyId")
+ .HasColumnType("int");
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DateIns")
+ .HasColumnType("datetime2");
+
+ b.Property("DateMod")
+ .HasColumnType("datetime2");
+
+ b.Property("DoorDescript")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DoorExtCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MeasureUnit")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ObjectQty")
+ .HasColumnType("int");
+
+ b.Property("ObjectType")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ObjectVal")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderDescript")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderExtCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("State")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("TypeId")
+ .HasColumnType("int");
+
+ b.Property("UnitCost")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("UserIdIns")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserIdMod")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ZipCode")
+ .HasColumnType("int");
+
+ b.HasKey("OrderId", "DoorId", "ObjectKey");
+
+ b.ToTable("DbSetPrtRepOrder");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.SerializedDoorsModel", b =>
+ {
+ b.Property("DoorTmpId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DoorTmpId"), 1L, 1);
+
+ b.Property("DoorSerVal")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Lock")
+ .HasColumnType("bit");
+
+ b.HasKey("DoorTmpId");
+
+ b.ToTable("SerializedDoors");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersViewModel", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("RoleId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ClaimId")
+ .HasColumnType("int");
+
+ b.Property("ClaimType")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ClaimValue")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("UserId", "RoleId", "ClaimId");
+
+ b.ToView("v_UserRolesClaims");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.VocabularyModel", b =>
+ {
+ b.Property("Lingua")
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("Lemma")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Traduzione")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.HasKey("Lingua", "Lemma");
+
+ b.ToTable("Vocabulary");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.VocabularyTempModel", b =>
+ {
+ b.Property("Lingua")
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("Lemma")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Traduzione")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.HasKey("Lingua", "Lemma");
+
+ b.ToTable("VocabularyTemp");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
+ {
+ b.HasOne("WebDoorCreator.Data.DbModels.AspNetRoles", "RolesNav")
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("WebDoorCreator.Data.DbModels.AspNetUsers", "UsersNav")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("RolesNav");
+
+ b.Navigation("UsersNav");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
+ {
+ b.HasOne("WebDoorCreator.Data.DbModels.OrderModel", "OrderNav")
+ .WithMany()
+ .HasForeignKey("OrderId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("OrderNav");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpModel", b =>
+ {
+ b.HasOne("WebDoorCreator.Data.DbModels.DoorModel", "DoorNav")
+ .WithMany()
+ .HasForeignKey("DoorId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DoorNav");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
+ {
+ b.HasOne("WebDoorCreator.Data.DbModels.CompanyModel", "CompanyNav")
+ .WithMany()
+ .HasForeignKey("CompanyId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("CompanyNav");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/WebDoorCreator.Data/Migrations/WDCData/20230605134244_DoorOpTypeUpdate.cs b/WebDoorCreator.Data/Migrations/WDCData/20230605134244_DoorOpTypeUpdate.cs
new file mode 100644
index 0000000..bbccc58
--- /dev/null
+++ b/WebDoorCreator.Data/Migrations/WDCData/20230605134244_DoorOpTypeUpdate.cs
@@ -0,0 +1,48 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace WebDoorCreator.Data.Migrations.WDCData
+{
+ public partial class DoorOpTypeUpdate : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "DoorOpIdPathFromPatriarch",
+ table: "DoorOpType");
+
+ migrationBuilder.DropColumn(
+ name: "JsoncConfig",
+ table: "DoorOpType");
+
+ migrationBuilder.AddColumn(
+ name: "UnitCost",
+ table: "DoorOpType",
+ type: "decimal(18,2)",
+ nullable: false,
+ defaultValue: 0m);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "UnitCost",
+ table: "DoorOpType");
+
+ migrationBuilder.AddColumn(
+ name: "DoorOpIdPathFromPatriarch",
+ table: "DoorOpType",
+ type: "hierarchyid",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "JsoncConfig",
+ table: "DoorOpType",
+ type: "nvarchar(max)",
+ nullable: false,
+ defaultValue: "");
+ }
+ }
+}
diff --git a/WebDoorCreator.Data/Migrations/WDCData/20230605135250_DoorOpTypeTempSetup.Designer.cs b/WebDoorCreator.Data/Migrations/WDCData/20230605135250_DoorOpTypeTempSetup.Designer.cs
new file mode 100644
index 0000000..b16ae67
--- /dev/null
+++ b/WebDoorCreator.Data/Migrations/WDCData/20230605135250_DoorOpTypeTempSetup.Designer.cs
@@ -0,0 +1,1055 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using WebDoorCreator.Data;
+
+#nullable disable
+
+namespace WebDoorCreator.Data.Migrations.WDCData
+{
+ [DbContext(typeof(WDCDataContext))]
+ [Migration("20230605135250_DoorOpTypeTempSetup")]
+ partial class DoorOpTypeTempSetup
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .UseCollation("Latin1_General_CI_AS")
+ .HasAnnotation("ProductVersion", "6.0.14")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetRoles", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ConcurrencyStamp")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("AspNetRoles", null, t => t.ExcludeFromMigrations());
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("RoleId")
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", null, t => t.ExcludeFromMigrations());
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUsers", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("bit");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("NormalizedEmail")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NormalizedUserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PasswordHash")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("SecurityStamp")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("bit");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("AspNetUsers", null, t => t.ExcludeFromMigrations());
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.CompanyModel", b =>
+ {
+ b.Property("CompanyId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CompanyId"), 1L, 1);
+
+ b.Property("Address")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("nvarchar(250)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("CompanyExtCode")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("nvarchar(250)");
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("CompanyToken")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("nvarchar(150)");
+
+ b.Property("PrivateNote")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("State")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ZipCode")
+ .HasColumnType("int");
+
+ b.HasKey("CompanyId");
+
+ b.ToTable("Company");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.ConfigModel", b =>
+ {
+ b.Property("chiave")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("note")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("valore")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("valoreStd")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("chiave");
+
+ b.ToTable("Config");
+ });
+
+ modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
+ {
+ b.Property("DoorId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DoorId"), 1L, 1);
+
+ b.Property("DateIns")
+ .HasColumnType("datetime2");
+
+ b.Property("DateLockExpiry")
+ .HasColumnType("datetime2");
+
+ b.Property("DateMod")
+ .HasColumnType("datetime2");
+
+ b.Property("DoorDescript")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DoorExtCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property