//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MiniMarket.Web.Data;
#nullable disable
namespace MiniMarket.Web.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260116072114_ActualizarConfiguracionDB")]
partial class ActualizarConfiguracionDB
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property("Id")
.HasColumnType("nvarchar(450)");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property("Id")
.HasColumnType("nvarchar(450)");
b.Property("AccessFailedCount")
.HasColumnType("int");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("EmailConfirmed")
.HasColumnType("bit");
b.Property("LockoutEnabled")
.HasColumnType("bit");
b.Property("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property("TwoFactorEnabled")
.HasColumnType("bit");
b.Property("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.Property("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("ProviderKey")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.Property("UserId")
.HasColumnType("nvarchar(450)");
b.Property("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.Property("UserId")
.HasColumnType("nvarchar(450)");
b.Property("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("Name")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("MiniMarket.Web.Models.AperturaCaja", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("EstaAbierta")
.HasColumnType("bit");
b.Property("FechaApertura")
.HasColumnType("datetime2");
b.Property("FechaCierre")
.HasColumnType("datetime2");
b.Property("MontoInicial")
.HasColumnType("decimal(18,2)");
b.Property("MontoReal")
.HasColumnType("decimal(18,2)");
b.Property("MontoSistema")
.HasColumnType("decimal(18,2)");
b.Property("UsuarioId")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("AperturasCaja");
});
modelBuilder.Entity("MiniMarket.Web.Models.Categoria", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Descripcion")
.HasColumnType("nvarchar(max)");
b.Property("Estado")
.HasColumnType("bit");
b.Property("Nombre")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Categorias");
});
modelBuilder.Entity("MiniMarket.Web.Models.Cliente", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Correo")
.HasColumnType("nvarchar(max)");
b.Property("Direccion")
.HasColumnType("nvarchar(max)");
b.Property("Documento")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Estado")
.HasColumnType("bit");
b.Property("Nombre")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Telefono")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clientes");
});
modelBuilder.Entity("MiniMarket.Web.Models.Compra", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Fecha")
.HasColumnType("datetime2");
b.Property("NumeroComprobante")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ProveedorId")
.HasColumnType("int");
b.Property("Total")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("ProveedorId");
b.ToTable("Compras");
});
modelBuilder.Entity("MiniMarket.Web.Models.Configuracion", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Correo")
.HasColumnType("nvarchar(max)");
b.Property("Direccion")
.HasColumnType("nvarchar(max)");
b.Property("MonedaSimbolo")
.HasColumnType("nvarchar(max)");
b.Property("NombreEmpresa")
.HasColumnType("nvarchar(max)");
b.Property("RUC")
.HasColumnType("nvarchar(max)");
b.Property("Telefono")
.HasColumnType("nvarchar(max)");
b.Property("ZonaHorariaId")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Configuraciones");
});
modelBuilder.Entity("MiniMarket.Web.Models.DetalleCompra", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Cantidad")
.HasColumnType("int");
b.Property("CompraId")
.HasColumnType("int");
b.Property("CostoUnitario")
.HasColumnType("decimal(18,2)");
b.Property("ProductoId")
.HasColumnType("int");
b.Property("Total")
.HasColumnType("decimal(18,2)");
b.HasKey("Id");
b.HasIndex("CompraId");
b.HasIndex("ProductoId");
b.ToTable("DetalleCompras");
});
modelBuilder.Entity("MiniMarket.Web.Models.DetalleVenta", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Cantidad")
.HasColumnType("int");
b.Property("PrecioUnitario")
.HasColumnType("decimal(18,2)");
b.Property("ProductoId")
.HasColumnType("int");
b.Property("SubTotal")
.HasColumnType("decimal(18,2)");
b.Property("VentaId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ProductoId");
b.HasIndex("VentaId");
b.ToTable("DetalleVentas");
});
modelBuilder.Entity("MiniMarket.Web.Models.MovimientoInventario", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Cantidad")
.HasColumnType("int");
b.Property("Fecha")
.HasColumnType("datetime2");
b.Property("ProductoId")
.HasColumnType("int");
b.Property("Referencia")
.HasColumnType("nvarchar(max)");
b.Property("TipoMovimiento")
.HasColumnType("nvarchar(max)");
b.Property("Usuario")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ProductoId");
b.ToTable("MovimientosInventario");
});
modelBuilder.Entity("MiniMarket.Web.Models.Producto", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CategoriaId")
.HasColumnType("int");
b.Property("Descripcion")
.HasColumnType("nvarchar(max)");
b.Property("Estado")
.HasColumnType("bit");
b.Property("ImagenUrl")
.HasColumnType("nvarchar(max)");
b.Property("Nombre")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Precio")
.HasColumnType("decimal(18,2)");
b.Property("Stock")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CategoriaId");
b.ToTable("Productos");
});
modelBuilder.Entity("MiniMarket.Web.Models.Proveedor", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Contacto")
.HasColumnType("nvarchar(max)");
b.Property("Correo")
.HasColumnType("nvarchar(max)");
b.Property("Direccion")
.HasColumnType("nvarchar(max)");
b.Property("Estado")
.HasColumnType("bit");
b.Property("RazonSocial")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Ruc")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Telefono")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Proveedores");
});
modelBuilder.Entity("MiniMarket.Web.Models.Venta", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClienteId")
.HasColumnType("int");
b.Property("Fecha")
.HasColumnType("datetime2");
b.Property("Total")
.HasColumnType("decimal(18,2)");
b.Property("UsuarioId")
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("ClienteId");
b.HasIndex("UsuarioId");
b.ToTable("Ventas");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("MiniMarket.Web.Models.Compra", b =>
{
b.HasOne("MiniMarket.Web.Models.Proveedor", "Proveedor")
.WithMany()
.HasForeignKey("ProveedorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Proveedor");
});
modelBuilder.Entity("MiniMarket.Web.Models.DetalleCompra", b =>
{
b.HasOne("MiniMarket.Web.Models.Compra", "Compra")
.WithMany("Detalles")
.HasForeignKey("CompraId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MiniMarket.Web.Models.Producto", "Producto")
.WithMany()
.HasForeignKey("ProductoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Compra");
b.Navigation("Producto");
});
modelBuilder.Entity("MiniMarket.Web.Models.DetalleVenta", b =>
{
b.HasOne("MiniMarket.Web.Models.Producto", "Producto")
.WithMany()
.HasForeignKey("ProductoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MiniMarket.Web.Models.Venta", "Venta")
.WithMany("Detalles")
.HasForeignKey("VentaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Producto");
b.Navigation("Venta");
});
modelBuilder.Entity("MiniMarket.Web.Models.MovimientoInventario", b =>
{
b.HasOne("MiniMarket.Web.Models.Producto", "Producto")
.WithMany()
.HasForeignKey("ProductoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Producto");
});
modelBuilder.Entity("MiniMarket.Web.Models.Producto", b =>
{
b.HasOne("MiniMarket.Web.Models.Categoria", "Categoria")
.WithMany()
.HasForeignKey("CategoriaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Categoria");
});
modelBuilder.Entity("MiniMarket.Web.Models.Venta", b =>
{
b.HasOne("MiniMarket.Web.Models.Cliente", "Cliente")
.WithMany()
.HasForeignKey("ClienteId");
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "Usuario")
.WithMany()
.HasForeignKey("UsuarioId");
b.Navigation("Cliente");
b.Navigation("Usuario");
});
modelBuilder.Entity("MiniMarket.Web.Models.Compra", b =>
{
b.Navigation("Detalles");
});
modelBuilder.Entity("MiniMarket.Web.Models.Venta", b =>
{
b.Navigation("Detalles");
});
#pragma warning restore 612, 618
}
}
}