diff --git a/TecniStamp/TecniStamp.Domain/Sezione.cs b/TecniStamp/TecniStamp.Domain/Sezione.cs index 64cb421..e0f042e 100644 --- a/TecniStamp/TecniStamp.Domain/Sezione.cs +++ b/TecniStamp/TecniStamp.Domain/Sezione.cs @@ -8,6 +8,8 @@ public class Sezione : EntitaBase public string Nome { get; set; } public int Ordinamento { get; set; } public string? Icona { get; set; } + public string Url { get; set; } + public bool Blank { get; set; } [InverseProperty(nameof(Feature.Sezione))] public List Features { get; set; } diff --git a/TecniStamp/TecniStamp.Infrastructure/Migrations/20260130133518_Url e Blank in sezione.Designer.cs b/TecniStamp/TecniStamp.Infrastructure/Migrations/20260130133518_Url e Blank in sezione.Designer.cs new file mode 100644 index 0000000..0b1c534 --- /dev/null +++ b/TecniStamp/TecniStamp.Infrastructure/Migrations/20260130133518_Url e Blank in sezione.Designer.cs @@ -0,0 +1,515 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using TecniStamp.Infrastructure.DAL.Context; + +#nullable disable + +namespace TecniStamp.Infrastructure.Migrations +{ + [DbContext(typeof(TecniStampDbContext))] + [Migration("20260130133518_Url e Blank in sezione")] + partial class UrleBlankinsezione + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("TecniStamp.Domain.Feature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DataCreazione") + .HasColumnType("datetime2"); + + b.Property("DataModifica") + .HasColumnType("datetime2"); + + b.Property("Descrizione") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Eliminato") + .HasColumnType("bit"); + + b.Property("IdUtenteCreazione") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteModifica") + .HasColumnType("uniqueidentifier"); + + b.Property("Nome") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Ordinamento") + .HasColumnType("int"); + + b.Property("SezioneId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("IdUtenteCreazione"); + + b.HasIndex("IdUtenteModifica"); + + b.HasIndex("SezioneId"); + + b.ToTable("Feature"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Lavorazione", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ChiaveEsterna") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Codice") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CodiceColore") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CostoOrario") + .HasColumnType("real"); + + b.Property("DataCreazione") + .HasColumnType("datetime2"); + + b.Property("DataModifica") + .HasColumnType("datetime2"); + + b.Property("Descrizione") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Eliminato") + .HasColumnType("bit"); + + b.Property("IdUtenteCreazione") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteModifica") + .HasColumnType("uniqueidentifier"); + + b.Property("Sovrapponibile") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("IdUtenteCreazione"); + + b.HasIndex("IdUtenteModifica"); + + b.ToTable("Lavorazione"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Macchinario", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CodiceEsterno") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigurazioneJSON") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigurazionePercorso") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DataCreazione") + .HasColumnType("datetime2"); + + b.Property("DataModifica") + .HasColumnType("datetime2"); + + b.Property("Descrizione") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Eliminato") + .HasColumnType("bit"); + + b.Property("IdUtenteCreazione") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteModifica") + .HasColumnType("uniqueidentifier"); + + b.Property("Interscambio") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("IdUtenteCreazione"); + + b.HasIndex("IdUtenteModifica"); + + b.ToTable("Macchinario"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DataCreazione") + .HasColumnType("datetime2"); + + b.Property("DataModifica") + .HasColumnType("datetime2"); + + b.Property("Eliminato") + .HasColumnType("bit"); + + b.Property("IdFeature") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteCreazione") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteModifica") + .HasColumnType("uniqueidentifier"); + + b.Property("RuoloId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("IdFeature"); + + b.HasIndex("IdUtenteCreazione"); + + b.HasIndex("IdUtenteModifica"); + + b.HasIndex("RuoloId"); + + b.ToTable("Permission"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Ruolo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DataCreazione") + .HasColumnType("datetime2"); + + b.Property("DataModifica") + .HasColumnType("datetime2"); + + b.Property("Eliminato") + .HasColumnType("bit"); + + b.Property("IdUtenteCreazione") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteModifica") + .HasColumnType("uniqueidentifier"); + + b.Property("Nome") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("IdUtenteCreazione"); + + b.HasIndex("IdUtenteModifica"); + + b.ToTable("Ruolo"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Sezione", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Blank") + .HasColumnType("bit"); + + b.Property("DataCreazione") + .HasColumnType("datetime2"); + + b.Property("DataModifica") + .HasColumnType("datetime2"); + + b.Property("Eliminato") + .HasColumnType("bit"); + + b.Property("Icona") + .HasColumnType("nvarchar(max)"); + + b.Property("IdUtenteCreazione") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteModifica") + .HasColumnType("uniqueidentifier"); + + b.Property("Nome") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Ordinamento") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Url") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("IdUtenteCreazione"); + + b.HasIndex("IdUtenteModifica"); + + b.HasIndex("ParentId"); + + b.ToTable("Sezione"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Utente", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Cognome") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Costo") + .HasColumnType("decimal(18,2)"); + + b.Property("DataCreazione") + .HasColumnType("datetime2"); + + b.Property("DataModifica") + .HasColumnType("datetime2"); + + b.Property("Eliminato") + .HasColumnType("bit"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IdUtenteCreazione") + .HasColumnType("uniqueidentifier"); + + b.Property("IdUtenteModifica") + .HasColumnType("uniqueidentifier"); + + b.Property("Nome") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RuoloId") + .HasColumnType("uniqueidentifier"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("IdUtenteCreazione"); + + b.HasIndex("IdUtenteModifica"); + + b.HasIndex("RuoloId"); + + b.ToTable("Utente"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Feature", b => + { + b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione") + .WithMany() + .HasForeignKey("IdUtenteCreazione"); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica") + .WithMany() + .HasForeignKey("IdUtenteModifica"); + + b.HasOne("TecniStamp.Domain.Sezione", "Sezione") + .WithMany("Features") + .HasForeignKey("SezioneId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Sezione"); + + b.Navigation("UtenteCreazione"); + + b.Navigation("UtenteModifica"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Lavorazione", b => + { + b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione") + .WithMany() + .HasForeignKey("IdUtenteCreazione"); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica") + .WithMany() + .HasForeignKey("IdUtenteModifica"); + + b.Navigation("UtenteCreazione"); + + b.Navigation("UtenteModifica"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Macchinario", b => + { + b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione") + .WithMany() + .HasForeignKey("IdUtenteCreazione"); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica") + .WithMany() + .HasForeignKey("IdUtenteModifica"); + + b.Navigation("UtenteCreazione"); + + b.Navigation("UtenteModifica"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Permission", b => + { + b.HasOne("TecniStamp.Domain.Feature", "Feature") + .WithMany() + .HasForeignKey("IdFeature") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione") + .WithMany() + .HasForeignKey("IdUtenteCreazione"); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica") + .WithMany() + .HasForeignKey("IdUtenteModifica"); + + b.HasOne("TecniStamp.Domain.Ruolo", "Ruolo") + .WithMany("Permessi") + .HasForeignKey("RuoloId"); + + b.Navigation("Feature"); + + b.Navigation("Ruolo"); + + b.Navigation("UtenteCreazione"); + + b.Navigation("UtenteModifica"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Ruolo", b => + { + b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione") + .WithMany() + .HasForeignKey("IdUtenteCreazione"); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica") + .WithMany() + .HasForeignKey("IdUtenteModifica"); + + b.Navigation("UtenteCreazione"); + + b.Navigation("UtenteModifica"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Sezione", b => + { + b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione") + .WithMany() + .HasForeignKey("IdUtenteCreazione"); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica") + .WithMany() + .HasForeignKey("IdUtenteModifica"); + + b.HasOne("TecniStamp.Domain.Sezione", "Parent") + .WithMany() + .HasForeignKey("ParentId"); + + b.Navigation("Parent"); + + b.Navigation("UtenteCreazione"); + + b.Navigation("UtenteModifica"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Utente", b => + { + b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione") + .WithMany() + .HasForeignKey("IdUtenteCreazione"); + + b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica") + .WithMany() + .HasForeignKey("IdUtenteModifica"); + + b.HasOne("TecniStamp.Domain.Ruolo", "Ruolo") + .WithMany("Utenti") + .HasForeignKey("RuoloId"); + + b.Navigation("Ruolo"); + + b.Navigation("UtenteCreazione"); + + b.Navigation("UtenteModifica"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Ruolo", b => + { + b.Navigation("Permessi"); + + b.Navigation("Utenti"); + }); + + modelBuilder.Entity("TecniStamp.Domain.Sezione", b => + { + b.Navigation("Features"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/TecniStamp/TecniStamp.Infrastructure/Migrations/20260130133518_Url e Blank in sezione.cs b/TecniStamp/TecniStamp.Infrastructure/Migrations/20260130133518_Url e Blank in sezione.cs new file mode 100644 index 0000000..60fbaf8 --- /dev/null +++ b/TecniStamp/TecniStamp.Infrastructure/Migrations/20260130133518_Url e Blank in sezione.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace TecniStamp.Infrastructure.Migrations +{ + /// + public partial class UrleBlankinsezione : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Blank", + table: "Sezione", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "Url", + table: "Sezione", + type: "nvarchar(max)", + nullable: false, + defaultValue: ""); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Blank", + table: "Sezione"); + + migrationBuilder.DropColumn( + name: "Url", + table: "Sezione"); + } + } +} diff --git a/TecniStamp/TecniStamp.Infrastructure/Migrations/TecniStampDbContextModelSnapshot.cs b/TecniStamp/TecniStamp.Infrastructure/Migrations/TecniStampDbContextModelSnapshot.cs index 4f9a817..3ab3fc2 100644 --- a/TecniStamp/TecniStamp.Infrastructure/Migrations/TecniStampDbContextModelSnapshot.cs +++ b/TecniStamp/TecniStamp.Infrastructure/Migrations/TecniStampDbContextModelSnapshot.cs @@ -252,6 +252,9 @@ namespace TecniStamp.Infrastructure.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("Blank") + .HasColumnType("bit"); + b.Property("DataCreazione") .HasColumnType("datetime2"); @@ -280,6 +283,10 @@ namespace TecniStamp.Infrastructure.Migrations b.Property("ParentId") .HasColumnType("uniqueidentifier"); + b.Property("Url") + .IsRequired() + .HasColumnType("nvarchar(max)"); + b.HasKey("Id"); b.HasIndex("IdUtenteCreazione");