Anagrafiche
This commit is contained in:
25
TecniStamp/TecniStamp.Domain/Cliente.cs
Normal file
25
TecniStamp/TecniStamp.Domain/Cliente.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using TecniStamp.Domain.Base;
|
||||
|
||||
namespace TecniStamp.Domain;
|
||||
|
||||
public class Cliente : EntitaBase
|
||||
{
|
||||
public string RagioneSociale { get; set; }
|
||||
public string PartitaIva { get; set; }
|
||||
public string Paese { get; set; }
|
||||
public string Telefono { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Indirizzo { get; set; }
|
||||
public string CAP { get; set; }
|
||||
public string Citta { get; set; }
|
||||
public string NumeroCivico { get; set; }
|
||||
public string Via { get; set; }
|
||||
public string Provincia { get; set; }
|
||||
public string Note { get; set; }
|
||||
|
||||
[ForeignKey(nameof(Comune))]
|
||||
public Guid? ComuneId { get; set; }
|
||||
public ComuneIstat Comune { get; set; }
|
||||
|
||||
}
|
||||
27
TecniStamp/TecniStamp.Domain/Commessa.cs
Normal file
27
TecniStamp/TecniStamp.Domain/Commessa.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using TecniStamp.Domain.Base;
|
||||
|
||||
namespace TecniStamp.Domain;
|
||||
|
||||
public class Commessa : EntitaBase
|
||||
{
|
||||
public string CodiceCommessa { get; set; }
|
||||
public int AnnoCommessa { get; set; }
|
||||
[ForeignKey(nameof(Cliente))]
|
||||
public Guid? ClienteId { get; set; }
|
||||
public Cliente Cliente { get; set; }
|
||||
public string RiferimentoCliente { get; set; }
|
||||
public string OrdineNr { get; set; }
|
||||
public decimal? OreTotali { get; set; }
|
||||
public DateTime DataOrdine { get; set; }
|
||||
public DateTime DataConsegnaPrevista { get; set; }
|
||||
public DateTime DataConsegna { get; set; }
|
||||
public CommessaStato Stato { get; set; }
|
||||
}
|
||||
|
||||
public enum CommessaStato
|
||||
{
|
||||
NonAvviata = 0,
|
||||
InLavorazione,
|
||||
Completata
|
||||
}
|
||||
18
TecniStamp/TecniStamp.Domain/ComuneIstat.cs
Normal file
18
TecniStamp/TecniStamp.Domain/ComuneIstat.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using TecniStamp.Domain.Base;
|
||||
|
||||
namespace TecniStamp.Domain;
|
||||
|
||||
public class ComuneIstat : EntitaBase
|
||||
{
|
||||
public string Istat { get; set; }
|
||||
public string Comune { get; set; }
|
||||
public string Regione { get; set; }
|
||||
public string Provincia { get; set; }
|
||||
public string Prefisso { get; set; }
|
||||
public string CodFisco { get; set; }
|
||||
|
||||
[ForeignKey(nameof(ProvinciaIstat))]
|
||||
public Guid? ProvinciaIstatId { get; set; }
|
||||
public ProvinciaIstat ProvinciaIstat { get; set; }
|
||||
}
|
||||
9
TecniStamp/TecniStamp.Domain/ProvinciaIstat.cs
Normal file
9
TecniStamp/TecniStamp.Domain/ProvinciaIstat.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using TecniStamp.Domain.Base;
|
||||
|
||||
namespace TecniStamp.Domain;
|
||||
|
||||
public class ProvinciaIstat : EntitaBase
|
||||
{
|
||||
public string Sigla { get; set; }
|
||||
public string Provincia { get; set; }
|
||||
}
|
||||
@ -9,10 +9,14 @@ public class TecniStampDbContext : OAServiceContext
|
||||
public TecniStampDbContext() : base() { }
|
||||
public TecniStampDbContext(DbContextOptions options) : base(options) { }
|
||||
|
||||
public DbSet<Cliente> Cliente { get; set; }
|
||||
public DbSet<Commessa> Commessa { get; set; }
|
||||
public DbSet<ComuneIstat> ComuneIstat { get; set; }
|
||||
public DbSet<Feature> Feature { get; set; }
|
||||
public DbSet<Lavorazione> Lavorazione { get; set; }
|
||||
public DbSet<Macchinario> Macchinario { get; set; }
|
||||
public DbSet<Permission> Permission { get; set; }
|
||||
public DbSet<ProvinciaIstat> ProvinciaIstat { get; set; }
|
||||
public DbSet<Ruolo> Ruolo { get; set; }
|
||||
public DbSet<Sezione> Sezione { get; set; }
|
||||
public DbSet<Utente> Utente { get; set; }
|
||||
|
||||
838
TecniStamp/TecniStamp.Infrastructure/Migrations/20260130155527_CommessaCliente.Designer.cs
generated
Normal file
838
TecniStamp/TecniStamp.Infrastructure/Migrations/20260130155527_CommessaCliente.Designer.cs
generated
Normal file
@ -0,0 +1,838 @@
|
||||
// <auto-generated />
|
||||
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("20260130155527_CommessaCliente")]
|
||||
partial class CommessaCliente
|
||||
{
|
||||
/// <inheritdoc />
|
||||
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.Cliente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CAP")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("ComuneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroCivico")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Paese")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Provincia")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Telefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Via")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ComuneId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Cliente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Commessa", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("AnnoCommessa")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CodiceCommessa")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataConsegna")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataConsegnaPrevista")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataOrdine")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("OrdineNr")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal?>("OreTotali")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("RiferimentoCliente")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Stato")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Commessa");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.ComuneIstat", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CodFisco")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Comune")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Istat")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Prefisso")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Provincia")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("ProvinciaIstatId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Regione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.HasIndex("ProvinciaIstatId");
|
||||
|
||||
b.ToTable("ComuneIstat");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Feature", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Ordinamento")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("SezioneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("ChiaveEsterna")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Codice")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodiceColore")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<float?>("CostoOrario")
|
||||
.HasColumnType("real");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Sovrapponibile")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Lavorazione");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Macchinario", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CodiceEsterno")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ConfigurazioneJSON")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ConfigurazionePercorso")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Interscambio")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Macchinario");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Permission", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("IdFeature")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("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.ProvinciaIstat", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Provincia")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Sigla")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("ProvinciaIstat");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Ruolo", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Blank")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Icona")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Ordinamento")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("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<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Costo")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("RuoloId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.HasIndex("RuoloId");
|
||||
|
||||
b.ToTable("Utente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Cliente", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.ComuneIstat", "Comune")
|
||||
.WithMany()
|
||||
.HasForeignKey("ComuneId");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Comune");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Commessa", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.ComuneIstat", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.ProvinciaIstat", "ProvinciaIstat")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProvinciaIstatId");
|
||||
|
||||
b.Navigation("ProvinciaIstat");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
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.ProvinciaIstat", 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.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
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,237 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TecniStamp.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class CommessaCliente : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ProvinciaIstat",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Sigla = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Provincia = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ProvinciaIstat", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ProvinciaIstat_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_ProvinciaIstat_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ComuneIstat",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Istat = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Comune = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Regione = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Provincia = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Prefisso = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CodFisco = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ProvinciaIstatId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ComuneIstat", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ComuneIstat_ProvinciaIstat_ProvinciaIstatId",
|
||||
column: x => x.ProvinciaIstatId,
|
||||
principalTable: "ProvinciaIstat",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_ComuneIstat_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_ComuneIstat_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cliente",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
RagioneSociale = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
PartitaIva = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Paese = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Telefono = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Indirizzo = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CAP = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Citta = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
NumeroCivico = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Via = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Provincia = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Note = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ComuneId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Cliente", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Cliente_ComuneIstat_ComuneId",
|
||||
column: x => x.ComuneId,
|
||||
principalTable: "ComuneIstat",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Cliente_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Cliente_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Commessa",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CodiceCommessa = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
AnnoCommessa = table.Column<int>(type: "int", nullable: false),
|
||||
ClienteId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
RiferimentoCliente = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
OrdineNr = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
OreTotali = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
|
||||
DataOrdine = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataConsegnaPrevista = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataConsegna = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Stato = table.Column<int>(type: "int", nullable: false),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Commessa", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Commessa_Cliente_ClienteId",
|
||||
column: x => x.ClienteId,
|
||||
principalTable: "Cliente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Commessa_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Commessa_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cliente_ComuneId",
|
||||
table: "Cliente",
|
||||
column: "ComuneId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cliente_IdUtenteCreazione",
|
||||
table: "Cliente",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cliente_IdUtenteModifica",
|
||||
table: "Cliente",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Commessa_ClienteId",
|
||||
table: "Commessa",
|
||||
column: "ClienteId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Commessa_IdUtenteCreazione",
|
||||
table: "Commessa",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Commessa_IdUtenteModifica",
|
||||
table: "Commessa",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ComuneIstat_IdUtenteCreazione",
|
||||
table: "ComuneIstat",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ComuneIstat_IdUtenteModifica",
|
||||
table: "ComuneIstat",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ComuneIstat_ProvinciaIstatId",
|
||||
table: "ComuneIstat",
|
||||
column: "ProvinciaIstatId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ProvinciaIstat_IdUtenteCreazione",
|
||||
table: "ProvinciaIstat",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ProvinciaIstat_IdUtenteModifica",
|
||||
table: "ProvinciaIstat",
|
||||
column: "IdUtenteModifica");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Commessa");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cliente");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ComuneIstat");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ProvinciaIstat");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,213 @@ namespace TecniStamp.Infrastructure.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Cliente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CAP")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("ComuneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroCivico")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Paese")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Provincia")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Telefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Via")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ComuneId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Cliente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Commessa", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("AnnoCommessa")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CodiceCommessa")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataConsegna")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataConsegnaPrevista")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataOrdine")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("OrdineNr")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal?>("OreTotali")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("RiferimentoCliente")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Stato")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Commessa");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.ComuneIstat", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CodFisco")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Comune")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Istat")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Prefisso")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Provincia")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("ProvinciaIstatId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Regione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.HasIndex("ProvinciaIstatId");
|
||||
|
||||
b.ToTable("ComuneIstat");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Feature", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -212,6 +419,44 @@ namespace TecniStamp.Infrastructure.Migrations
|
||||
b.ToTable("Permission");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.ProvinciaIstat", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Provincia")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Sigla")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("ProvinciaIstat");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Ruolo", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -356,6 +601,69 @@ namespace TecniStamp.Infrastructure.Migrations
|
||||
b.ToTable("Utente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Cliente", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.ComuneIstat", "Comune")
|
||||
.WithMany()
|
||||
.HasForeignKey("ComuneId");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Comune");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Commessa", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.ComuneIstat", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.HasOne("TecniStamp.Domain.ProvinciaIstat", "ProvinciaIstat")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProvinciaIstatId");
|
||||
|
||||
b.Navigation("ProvinciaIstat");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.Feature", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
@ -438,6 +746,21 @@ namespace TecniStamp.Infrastructure.Migrations
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TecniStamp.Domain.ProvinciaIstat", 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.Ruolo", b =>
|
||||
{
|
||||
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
|
||||
|
||||
Reference in New Issue
Block a user