// <auto-generated />
using System;
using Apollinare.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace Apollinare.Infrastructure.Migrations
{
    [DbContext(typeof(AppollinareDbContext))]
    partial class AppollinareDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "9.0.0");

            modelBuilder.Entity("Apollinare.Domain.Entities.AppModule", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("BasePrice")
                        .HasPrecision(18, 2)
                        .HasColumnType("TEXT");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Dependencies")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<string>("Icon")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsAvailable")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsCore")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("MonthlyMultiplier")
                        .HasPrecision(5, 2)
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("RoutePath")
                        .HasColumnType("TEXT");

                    b.Property<int>("SortOrder")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("SortOrder");

                    b.ToTable("AppModules");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Articolo", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("CategoriaId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("CodiceAlternativo")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<byte[]>("Immagine")
                        .HasColumnType("BLOB");

                    b.Property<string>("MimeType")
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("QtaDisponibile")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("QtaStdA")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("QtaStdB")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("QtaStdS")
                        .HasColumnType("TEXT");

                    b.Property<int?>("TipoMaterialeId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("UnitaMisura")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("CategoriaId");

                    b.HasIndex("Codice")
                        .IsUnique();

                    b.HasIndex("TipoMaterialeId");

                    b.ToTable("Articoli");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.AutoCode", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<string>("EntityCode")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("EntityName")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsReadOnly")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("LastResetMonth")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("LastResetYear")
                        .HasColumnType("INTEGER");

                    b.Property<long>("LastSequence")
                        .HasColumnType("INTEGER");

                    b.Property<string>("ModuleCode")
                        .HasColumnType("TEXT");

                    b.Property<string>("Pattern")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Prefix")
                        .HasColumnType("TEXT");

                    b.Property<bool>("ResetSequenceMonthly")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("ResetSequenceYearly")
                        .HasColumnType("INTEGER");

                    b.Property<int>("SortOrder")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("EntityCode")
                        .IsUnique();

                    b.HasIndex("ModuleCode");

                    b.ToTable("AutoCodes");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Cliente", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Cap")
                        .HasColumnType("TEXT");

                    b.Property<string>("Citta")
                        .HasColumnType("TEXT");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("CodiceAlternativo")
                        .HasColumnType("TEXT");

                    b.Property<string>("CodiceDestinatario")
                        .HasColumnType("TEXT");

                    b.Property<string>("CodiceFiscale")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Email")
                        .HasColumnType("TEXT");

                    b.Property<string>("Indirizzo")
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<string>("PartitaIva")
                        .HasColumnType("TEXT");

                    b.Property<string>("Pec")
                        .HasColumnType("TEXT");

                    b.Property<string>("Provincia")
                        .HasColumnType("TEXT");

                    b.Property<string>("RagioneSociale")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Telefono")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("PartitaIva");

                    b.HasIndex("RagioneSociale");

                    b.ToTable("Clienti");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.CodiceCategoria", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<decimal>("CoeffA")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("CoeffB")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("CoeffS")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("CodiciCategoria");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Configurazione", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Chiave")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Valore")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Chiave")
                        .IsUnique();

                    b.ToTable("Configurazioni");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Evento", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int?>("ClienteId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .HasColumnType("TEXT");

                    b.Property<bool>("Confermato")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("CostoPersona")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("CostoTotale")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("DataEvento")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("DataScadenzaPreventivo")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .HasColumnType("TEXT");

                    b.Property<int?>("LocationId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("NoteAllestimento")
                        .HasColumnType("TEXT");

                    b.Property<string>("NoteCliente")
                        .HasColumnType("TEXT");

                    b.Property<string>("NoteCucina")
                        .HasColumnType("TEXT");

                    b.Property<string>("NoteInterne")
                        .HasColumnType("TEXT");

                    b.Property<int?>("NumeroOspiti")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("NumeroOspitiAdulti")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("NumeroOspitiBambini")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("NumeroOspitiBuffet")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("NumeroOspitiSeduti")
                        .HasColumnType("INTEGER");

                    b.Property<TimeSpan?>("OraFine")
                        .HasColumnType("TEXT");

                    b.Property<TimeSpan?>("OraInizio")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("Saldo")
                        .HasColumnType("TEXT");

                    b.Property<int>("Stato")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("TipoEventoId")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("TotaleAcconti")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("ClienteId");

                    b.HasIndex("Codice");

                    b.HasIndex("DataEvento");

                    b.HasIndex("LocationId");

                    b.HasIndex("Stato");

                    b.HasIndex("TipoEventoId");

                    b.ToTable("Eventi");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoAcconto", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("AConferma")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("DataPagamento")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .HasColumnType("TEXT");

                    b.Property<int>("EventoId")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("Importo")
                        .HasColumnType("TEXT");

                    b.Property<string>("MetodoPagamento")
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<int>("Ordine")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("EventoId");

                    b.ToTable("EventiAcconti");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoAllegato", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<byte[]>("Contenuto")
                        .HasColumnType("BLOB");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("EventoId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("MimeType")
                        .HasColumnType("TEXT");

                    b.Property<string>("NomeFile")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("EventoId");

                    b.ToTable("EventiAllegati");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoAltroCosto", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("AliquotaIva")
                        .HasColumnType("TEXT");

                    b.Property<bool>("ApplicaIva")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("CostoUnitario")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<int>("EventoId")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Ordine")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("Quantita")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("EventoId");

                    b.ToTable("EventiAltriCosti");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDegustazione", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Completata")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("CostoDegustazione")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("DataDegustazione")
                        .HasColumnType("TEXT");

                    b.Property<bool>("Detraibile")
                        .HasColumnType("INTEGER");

                    b.Property<int>("EventoId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Luogo")
                        .HasColumnType("TEXT");

                    b.Property<string>("Menu")
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<int?>("NumeroPaganti")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("NumeroPersone")
                        .HasColumnType("INTEGER");

                    b.Property<TimeSpan?>("Ora")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("EventoId");

                    b.ToTable("EventiDegustazioni");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDettaglioOspiti", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("CostoUnitario")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("EventoId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<int>("Numero")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Ordine")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("Sconto")
                        .HasColumnType("TEXT");

                    b.Property<int>("TipoOspiteId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("EventoId");

                    b.HasIndex("TipoOspiteId");

                    b.ToTable("EventiDettaglioOspiti");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDettaglioPrelievo", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticoloId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("EventoId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("QtaCalcolata")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("QtaEffettiva")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("QtaRichiesta")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("ArticoloId");

                    b.HasIndex("EventoId");

                    b.ToTable("EventiDettaglioPrelievo");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDettaglioRisorsa", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("Costo")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("EventoId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<TimeSpan?>("OraFine")
                        .HasColumnType("TEXT");

                    b.Property<TimeSpan?>("OraInizio")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("OreLavoro")
                        .HasColumnType("TEXT");

                    b.Property<int>("RisorsaId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Ruolo")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("EventoId");

                    b.HasIndex("RisorsaId");

                    b.ToTable("EventiDettaglioRisorse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Location", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Cap")
                        .HasColumnType("TEXT");

                    b.Property<string>("Citta")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("DistanzaKm")
                        .HasColumnType("TEXT");

                    b.Property<string>("Email")
                        .HasColumnType("TEXT");

                    b.Property<string>("Indirizzo")
                        .HasColumnType("TEXT");

                    b.Property<string>("Nome")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<string>("Provincia")
                        .HasColumnType("TEXT");

                    b.Property<string>("Referente")
                        .HasColumnType("TEXT");

                    b.Property<string>("Telefono")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Nome");

                    b.ToTable("Location");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.ModuleSubscription", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("AutoRenew")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("EndDate")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("LastRenewalDate")
                        .HasColumnType("TEXT");

                    b.Property<int>("ModuleId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("PaidPrice")
                        .HasPrecision(18, 2)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("StartDate")
                        .HasColumnType("TEXT");

                    b.Property<int>("SubscriptionType")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("ModuleId")
                        .IsUnique();

                    b.ToTable("ModuleSubscriptions");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.ReportFont", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<long>("FileSize")
                        .HasColumnType("INTEGER");

                    b.Property<byte[]>("FontData")
                        .IsRequired()
                        .HasColumnType("BLOB");

                    b.Property<string>("FontFamily")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("FontStyle")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("MimeType")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Nome")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("FontFamily");

                    b.ToTable("ReportFonts");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.ReportImage", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Categoria")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<long>("FileSize")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Height")
                        .HasColumnType("INTEGER");

                    b.Property<byte[]>("ImageData")
                        .IsRequired()
                        .HasColumnType("BLOB");

                    b.Property<string>("MimeType")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Nome")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("Width")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("Categoria");

                    b.ToTable("ReportImages");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.ReportTemplate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Categoria")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .HasColumnType("TEXT");

                    b.Property<string>("Nome")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Orientation")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("PageSize")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("TemplateJson")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<byte[]>("Thumbnail")
                        .HasColumnType("BLOB");

                    b.Property<string>("ThumbnailMimeType")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Categoria");

                    b.HasIndex("Nome");

                    b.ToTable("ReportTemplates");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Risorsa", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Cognome")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Email")
                        .HasColumnType("TEXT");

                    b.Property<string>("Nome")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<string>("Telefono")
                        .HasColumnType("TEXT");

                    b.Property<int?>("TipoRisorsaId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("TipoRisorsaId");

                    b.ToTable("Risorse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoEvento", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<int?>("TipoPastoId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("TipoPastoId");

                    b.ToTable("TipiEvento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoMateriale", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("TipiMateriale");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoOspite", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("TipiOspite");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoPasto", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("TipiPasto");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoRisorsa", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Codice")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("TipiRisorsa");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Utente", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Cognome")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Email")
                        .HasColumnType("TEXT");

                    b.Property<string>("Nome")
                        .HasColumnType("TEXT");

                    b.Property<string>("Ruolo")
                        .HasColumnType("TEXT");

                    b.Property<bool>("SolaLettura")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Username")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Username")
                        .IsUnique();

                    b.ToTable("Utenti");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.VirtualDataset", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<bool>("Attivo")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Categoria")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("ConfigurationJson")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Descrizione")
                        .HasColumnType("TEXT");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Icon")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Nome")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Categoria");

                    b.HasIndex("Nome")
                        .IsUnique();

                    b.ToTable("VirtualDatasets");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleBarcode", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Barcode")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsActive")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsPrimary")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("Quantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int>("Type")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("ArticleId");

                    b.HasIndex("Barcode")
                        .IsUnique();

                    b.ToTable("ArticleBarcodes", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleBatch", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("BatchNumber")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Certifications")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("CurrentQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("ExpiryDate")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("InitialQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("LastQualityCheckDate")
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("ProductionDate")
                        .HasColumnType("TEXT");

                    b.Property<int?>("QualityStatus")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("ReservedQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int>("Status")
                        .HasColumnType("INTEGER");

                    b.Property<string>("SupplierBatch")
                        .HasColumnType("TEXT");

                    b.Property<int?>("SupplierId")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("UnitCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("ExpiryDate");

                    b.HasIndex("Status");

                    b.HasIndex("ArticleId", "BatchNumber")
                        .IsUnique();

                    b.ToTable("ArticleBatches", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleSerial", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Attributes")
                        .HasColumnType("TEXT");

                    b.Property<int?>("BatchId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int?>("CurrentWarehouseId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("CustomerId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("ManufacturerSerial")
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("ProductionDate")
                        .HasColumnType("TEXT");

                    b.Property<string>("SalesReference")
                        .HasColumnType("TEXT");

                    b.Property<string>("SerialNumber")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("SoldDate")
                        .HasColumnType("TEXT");

                    b.Property<int>("Status")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("SupplierId")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("UnitCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("WarrantyExpiryDate")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("BatchId");

                    b.HasIndex("CurrentWarehouseId");

                    b.HasIndex("Status");

                    b.HasIndex("ArticleId", "SerialNumber")
                        .IsUnique();

                    b.ToTable("ArticleSerials", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.InventoryCount", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int?>("AdjustmentMovementId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("CategoryId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("ConfirmedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("ConfirmedDate")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("EndDate")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("InventoryDate")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("NegativeDifferenceValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("PositiveDifferenceValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("StartDate")
                        .HasColumnType("TEXT");

                    b.Property<int>("Status")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Type")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int?>("WarehouseId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("AdjustmentMovementId");

                    b.HasIndex("CategoryId");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("InventoryDate");

                    b.HasIndex("Status");

                    b.HasIndex("WarehouseId");

                    b.ToTable("InventoryCounts", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.InventoryCountLine", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("BatchId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CountedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CountedBy")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("CountedQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("InventoryCountId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("LocationCode")
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<string>("SecondCountBy")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("SecondCountQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("TheoreticalQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("UnitCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("WarehouseId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("ArticleId");

                    b.HasIndex("BatchId");

                    b.HasIndex("WarehouseId");

                    b.HasIndex("InventoryCountId", "ArticleId", "WarehouseId", "BatchId")
                        .IsUnique();

                    b.ToTable("InventoryCountLines", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.MovementReason", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsActive")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsSystem")
                        .HasColumnType("INTEGER");

                    b.Property<int>("MovementType")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<bool>("RequiresExternalReference")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("RequiresValuation")
                        .HasColumnType("INTEGER");

                    b.Property<int>("SortOrder")
                        .HasColumnType("INTEGER");

                    b.Property<int>("StockSign")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<bool>("UpdatesAverageCost")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsActive");

                    b.HasIndex("MovementType");

                    b.ToTable("MovementReasons", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockLevel", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("BatchId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("LastInventoryDate")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("LastMovementDate")
                        .HasColumnType("TEXT");

                    b.Property<string>("LocationCode")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("OnOrderQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("Quantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("ReservedQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("StockValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("UnitCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("WarehouseId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("BatchId");

                    b.HasIndex("LocationCode");

                    b.HasIndex("WarehouseId");

                    b.HasIndex("ArticleId", "WarehouseId", "BatchId")
                        .IsUnique();

                    b.ToTable("StockLevels", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockMovement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("ConfirmedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("ConfirmedDate")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int?>("CustomerId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("DestinationWarehouseId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("DocumentNumber")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<int?>("ExternalDocumentType")
                        .HasColumnType("INTEGER");

                    b.Property<string>("ExternalReference")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("MovementDate")
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<int?>("ReasonId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("SourceWarehouseId")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Status")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("SupplierId")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("TotalValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int>("Type")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("DestinationWarehouseId");

                    b.HasIndex("DocumentNumber")
                        .IsUnique();

                    b.HasIndex("ExternalReference");

                    b.HasIndex("MovementDate");

                    b.HasIndex("ReasonId");

                    b.HasIndex("SourceWarehouseId");

                    b.HasIndex("Status");

                    b.HasIndex("Type");

                    b.ToTable("StockMovements", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockMovementLine", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("BatchId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("DestinationLocationCode")
                        .HasColumnType("TEXT");

                    b.Property<string>("ExternalLineReference")
                        .HasColumnType("TEXT");

                    b.Property<int>("LineNumber")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("LineValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int>("MovementId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("Quantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int?>("SerialId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("SourceLocationCode")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("UnitCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<string>("UnitOfMeasure")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("ArticleId");

                    b.HasIndex("BatchId");

                    b.HasIndex("SerialId");

                    b.HasIndex("MovementId", "LineNumber")
                        .IsUnique();

                    b.ToTable("StockMovementLines", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockValuation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("ClosedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("ClosedDate")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("InboundQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("InboundValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsClosed")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Method")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("OutboundQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("OutboundValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int>("Period")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("Quantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("TotalValue")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("UnitCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("ValuationDate")
                        .HasColumnType("TEXT");

                    b.Property<int?>("WarehouseId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("ArticleId");

                    b.HasIndex("IsClosed");

                    b.HasIndex("ValuationDate");

                    b.HasIndex("WarehouseId");

                    b.HasIndex("Period", "ArticleId", "WarehouseId")
                        .IsUnique();

                    b.ToTable("StockValuations", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockValuationLayer", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<int>("ArticleId")
                        .HasColumnType("INTEGER");

                    b.Property<int?>("BatchId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsExhausted")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime>("LayerDate")
                        .HasColumnType("TEXT");

                    b.Property<decimal>("OriginalQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal>("RemainingQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int?>("SourceMovementId")
                        .HasColumnType("INTEGER");

                    b.Property<decimal>("UnitCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int>("WarehouseId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("BatchId");

                    b.HasIndex("IsExhausted");

                    b.HasIndex("SourceMovementId");

                    b.HasIndex("WarehouseId");

                    b.HasIndex("ArticleId", "WarehouseId", "LayerDate");

                    b.ToTable("StockValuationLayers", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("AlternativeCode")
                        .HasColumnType("TEXT");

                    b.Property<string>("Barcode")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("BaseSellingPrice")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int?>("CategoryId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("Depth")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<int?>("ExpiryWarningDays")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("HasExpiry")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("Height")
                        .HasColumnType("TEXT");

                    b.Property<byte[]>("Image")
                        .HasColumnType("BLOB");

                    b.Property<string>("ImageMimeType")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsActive")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsBatchManaged")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsSerialManaged")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("LastPurchaseCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int?>("LeadTimeDays")
                        .HasColumnType("INTEGER");

                    b.Property<string>("ManufacturerCode")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("MaximumStock")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("MinimumStock")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("ReorderPoint")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("ReorderQuantity")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<string>("SecondaryUnitOfMeasure")
                        .HasColumnType("TEXT");

                    b.Property<string>("ShortDescription")
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("StandardCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<int>("StockManagement")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("UnitConversionFactor")
                        .HasPrecision(18, 6)
                        .HasColumnType("TEXT");

                    b.Property<string>("UnitOfMeasure")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int?>("ValuationMethod")
                        .HasColumnType("INTEGER");

                    b.Property<decimal?>("Volume")
                        .HasPrecision(18, 6)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("Weight")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("WeightedAverageCost")
                        .HasPrecision(18, 4)
                        .HasColumnType("TEXT");

                    b.Property<decimal?>("Width")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Barcode");

                    b.HasIndex("CategoryId");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsActive");

                    b.ToTable("WarehouseArticles", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseArticleCategory", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("AlternativeCode")
                        .HasColumnType("TEXT");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Color")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<int?>("DefaultValuationMethod")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<string>("FullPath")
                        .HasColumnType("TEXT");

                    b.Property<string>("Icon")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsActive")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Level")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<int?>("ParentCategoryId")
                        .HasColumnType("INTEGER");

                    b.Property<int>("SortOrder")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("FullPath");

                    b.HasIndex("ParentCategoryId");

                    b.ToTable("WarehouseArticleCategories", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Address")
                        .HasColumnType("TEXT");

                    b.Property<string>("AlternativeCode")
                        .HasColumnType("TEXT");

                    b.Property<string>("City")
                        .HasColumnType("TEXT");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Country")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsActive")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("IsDefault")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Notes")
                        .HasColumnType("TEXT");

                    b.Property<string>("PostalCode")
                        .HasColumnType("TEXT");

                    b.Property<string>("Province")
                        .HasColumnType("TEXT");

                    b.Property<int>("SortOrder")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Type")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsActive");

                    b.HasIndex("IsDefault");

                    b.ToTable("WarehouseLocations", (string)null);
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Articolo", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.CodiceCategoria", "Categoria")
                        .WithMany("Articoli")
                        .HasForeignKey("CategoriaId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.TipoMateriale", "TipoMateriale")
                        .WithMany("Articoli")
                        .HasForeignKey("TipoMaterialeId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Categoria");

                    b.Navigation("TipoMateriale");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Evento", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Cliente", "Cliente")
                        .WithMany("Eventi")
                        .HasForeignKey("ClienteId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Location", "Location")
                        .WithMany("Eventi")
                        .HasForeignKey("LocationId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.TipoEvento", "TipoEvento")
                        .WithMany("Eventi")
                        .HasForeignKey("TipoEventoId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Cliente");

                    b.Navigation("Location");

                    b.Navigation("TipoEvento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoAcconto", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Evento", "Evento")
                        .WithMany("Acconti")
                        .HasForeignKey("EventoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Evento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoAllegato", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Evento", "Evento")
                        .WithMany("Allegati")
                        .HasForeignKey("EventoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Evento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoAltroCosto", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Evento", "Evento")
                        .WithMany("AltriCosti")
                        .HasForeignKey("EventoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Evento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDegustazione", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Evento", "Evento")
                        .WithMany("Degustazioni")
                        .HasForeignKey("EventoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Evento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDettaglioOspiti", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Evento", "Evento")
                        .WithMany("DettagliOspiti")
                        .HasForeignKey("EventoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.TipoOspite", "TipoOspite")
                        .WithMany("DettagliOspiti")
                        .HasForeignKey("TipoOspiteId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Evento");

                    b.Navigation("TipoOspite");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDettaglioPrelievo", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Articolo", "Articolo")
                        .WithMany("DettagliPrelievo")
                        .HasForeignKey("ArticoloId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Evento", "Evento")
                        .WithMany("DettagliPrelievo")
                        .HasForeignKey("EventoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Articolo");

                    b.Navigation("Evento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.EventoDettaglioRisorsa", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Evento", "Evento")
                        .WithMany("DettagliRisorse")
                        .HasForeignKey("EventoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Risorsa", "Risorsa")
                        .WithMany("DettagliRisorse")
                        .HasForeignKey("RisorsaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Evento");

                    b.Navigation("Risorsa");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.ModuleSubscription", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.AppModule", "Module")
                        .WithOne("Subscription")
                        .HasForeignKey("Apollinare.Domain.Entities.ModuleSubscription", "ModuleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Module");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Risorsa", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.TipoRisorsa", "TipoRisorsa")
                        .WithMany("Risorse")
                        .HasForeignKey("TipoRisorsaId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("TipoRisorsa");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoEvento", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.TipoPasto", "TipoPasto")
                        .WithMany("TipiEvento")
                        .HasForeignKey("TipoPastoId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("TipoPasto");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleBarcode", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany("Barcodes")
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Article");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleBatch", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany("Batches")
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Article");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleSerial", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany("Serials")
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.ArticleBatch", "Batch")
                        .WithMany("Serials")
                        .HasForeignKey("BatchId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "CurrentWarehouse")
                        .WithMany()
                        .HasForeignKey("CurrentWarehouseId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Article");

                    b.Navigation("Batch");

                    b.Navigation("CurrentWarehouse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.InventoryCount", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.StockMovement", "AdjustmentMovement")
                        .WithMany()
                        .HasForeignKey("AdjustmentMovementId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticleCategory", "Category")
                        .WithMany()
                        .HasForeignKey("CategoryId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "Warehouse")
                        .WithMany()
                        .HasForeignKey("WarehouseId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("AdjustmentMovement");

                    b.Navigation("Category");

                    b.Navigation("Warehouse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.InventoryCountLine", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany()
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.ArticleBatch", "Batch")
                        .WithMany()
                        .HasForeignKey("BatchId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.InventoryCount", "InventoryCount")
                        .WithMany("Lines")
                        .HasForeignKey("InventoryCountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "Warehouse")
                        .WithMany()
                        .HasForeignKey("WarehouseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Article");

                    b.Navigation("Batch");

                    b.Navigation("InventoryCount");

                    b.Navigation("Warehouse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockLevel", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany("StockLevels")
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.ArticleBatch", "Batch")
                        .WithMany("StockLevels")
                        .HasForeignKey("BatchId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "Warehouse")
                        .WithMany("StockLevels")
                        .HasForeignKey("WarehouseId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Article");

                    b.Navigation("Batch");

                    b.Navigation("Warehouse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockMovement", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "DestinationWarehouse")
                        .WithMany("DestinationMovements")
                        .HasForeignKey("DestinationWarehouseId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.MovementReason", "Reason")
                        .WithMany("Movements")
                        .HasForeignKey("ReasonId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "SourceWarehouse")
                        .WithMany("SourceMovements")
                        .HasForeignKey("SourceWarehouseId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("DestinationWarehouse");

                    b.Navigation("Reason");

                    b.Navigation("SourceWarehouse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockMovementLine", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany("MovementLines")
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.ArticleBatch", "Batch")
                        .WithMany("MovementLines")
                        .HasForeignKey("BatchId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.StockMovement", "Movement")
                        .WithMany("Lines")
                        .HasForeignKey("MovementId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.ArticleSerial", "Serial")
                        .WithMany("MovementLines")
                        .HasForeignKey("SerialId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Article");

                    b.Navigation("Batch");

                    b.Navigation("Movement");

                    b.Navigation("Serial");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockValuation", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany()
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "Warehouse")
                        .WithMany()
                        .HasForeignKey("WarehouseId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Article");

                    b.Navigation("Warehouse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockValuationLayer", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", "Article")
                        .WithMany()
                        .HasForeignKey("ArticleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.ArticleBatch", "Batch")
                        .WithMany()
                        .HasForeignKey("BatchId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.StockMovement", "SourceMovement")
                        .WithMany()
                        .HasForeignKey("SourceMovementId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", "Warehouse")
                        .WithMany()
                        .HasForeignKey("WarehouseId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Article");

                    b.Navigation("Batch");

                    b.Navigation("SourceMovement");

                    b.Navigation("Warehouse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticleCategory", "Category")
                        .WithMany("Articles")
                        .HasForeignKey("CategoryId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Category");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseArticleCategory", b =>
                {
                    b.HasOne("Apollinare.Domain.Entities.Warehouse.WarehouseArticleCategory", "ParentCategory")
                        .WithMany("ChildCategories")
                        .HasForeignKey("ParentCategoryId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("ParentCategory");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.AppModule", b =>
                {
                    b.Navigation("Subscription");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Articolo", b =>
                {
                    b.Navigation("DettagliPrelievo");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Cliente", b =>
                {
                    b.Navigation("Eventi");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.CodiceCategoria", b =>
                {
                    b.Navigation("Articoli");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Evento", b =>
                {
                    b.Navigation("Acconti");

                    b.Navigation("Allegati");

                    b.Navigation("AltriCosti");

                    b.Navigation("Degustazioni");

                    b.Navigation("DettagliOspiti");

                    b.Navigation("DettagliPrelievo");

                    b.Navigation("DettagliRisorse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Location", b =>
                {
                    b.Navigation("Eventi");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Risorsa", b =>
                {
                    b.Navigation("DettagliRisorse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoEvento", b =>
                {
                    b.Navigation("Eventi");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoMateriale", b =>
                {
                    b.Navigation("Articoli");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoOspite", b =>
                {
                    b.Navigation("DettagliOspiti");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoPasto", b =>
                {
                    b.Navigation("TipiEvento");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.TipoRisorsa", b =>
                {
                    b.Navigation("Risorse");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleBatch", b =>
                {
                    b.Navigation("MovementLines");

                    b.Navigation("Serials");

                    b.Navigation("StockLevels");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.ArticleSerial", b =>
                {
                    b.Navigation("MovementLines");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.InventoryCount", b =>
                {
                    b.Navigation("Lines");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.MovementReason", b =>
                {
                    b.Navigation("Movements");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.StockMovement", b =>
                {
                    b.Navigation("Lines");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseArticle", b =>
                {
                    b.Navigation("Barcodes");

                    b.Navigation("Batches");

                    b.Navigation("MovementLines");

                    b.Navigation("Serials");

                    b.Navigation("StockLevels");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseArticleCategory", b =>
                {
                    b.Navigation("Articles");

                    b.Navigation("ChildCategories");
                });

            modelBuilder.Entity("Apollinare.Domain.Entities.Warehouse.WarehouseLocation", b =>
                {
                    b.Navigation("DestinationMovements");

                    b.Navigation("SourceMovements");

                    b.Navigation("StockLevels");
                });
#pragma warning restore 612, 618
        }
    }
}
