Test Docker

This commit is contained in:
2025-08-15 17:31:51 -03:00
parent 39b1e97072
commit bce5b1dcec
97 changed files with 8493 additions and 216 deletions

View File

@@ -10,7 +10,11 @@ public class EleccionesDbContext(DbContextOptions<EleccionesDbContext> options)
public DbSet<AmbitoGeografico> AmbitosGeograficos { get; set; }
public DbSet<ResultadoVoto> ResultadosVotos { get; set; }
public DbSet<EstadoRecuento> EstadosRecuentos { get; set; }
// Podríamos añadir más tablas como CategoriaElectoral o ProyeccionBanca aquí
public DbSet<ProyeccionBanca> ProyeccionesBancas { get; set; }
public DbSet<Telegrama> Telegramas { get; set; }
public DbSet<ResumenVoto> ResumenesVotos { get; set; }
public DbSet<EstadoRecuentoGeneral> EstadosRecuentosGenerales { get; set; }
public DbSet<CategoriaElectoral> CategoriasElectorales { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@@ -27,5 +31,13 @@ public class EleccionesDbContext(DbContextOptions<EleccionesDbContext> options)
entity.Property(e => e.MesasTotalizadasPorcentaje).HasPrecision(5, 2);
entity.Property(e => e.ParticipacionPorcentaje).HasPrecision(5, 2);
});
modelBuilder.Entity<ResumenVoto>()
.Property(e => e.VotosPorcentaje).HasPrecision(5, 2);
modelBuilder.Entity<EstadoRecuentoGeneral>(entity =>
{
entity.Property(e => e.MesasTotalizadasPorcentaje).HasPrecision(5, 2);
entity.Property(e => e.ParticipacionPorcentaje).HasPrecision(5, 2);
});
}
}

View File

@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elecciones.Database.Entities;
public class CategoriaElectoral
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)] // La API nos da el ID, no la BD.
public int Id { get; set; } // Corresponde a 'categoriald'
[Required]
public string Nombre { get; set; } = null!;
public int Orden { get; set; }
}

View File

@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elecciones.Database.Entities;
public class EstadoRecuentoGeneral
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)] // Le dice a EF que no genere este valor.
public int AmbitoGeograficoId { get; set; }
public int MesasEsperadas { get; set; }
public int MesasTotalizadas { get; set; }
public decimal MesasTotalizadasPorcentaje { get; set; }
public int CantidadElectores { get; set; }
public int CantidadVotantes { get; set; }
public decimal ParticipacionPorcentaje { get; set; }
}

View File

@@ -0,0 +1,25 @@
// src/Elecciones.Database/Entities/ProyeccionBanca.cs
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elecciones.Database.Entities;
public class ProyeccionBanca
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
// El ámbito donde se proyecta (ej. Sección Electoral)
public int AmbitoGeograficoId { get; set; }
[ForeignKey("AmbitoGeograficoId")]
public AmbitoGeografico AmbitoGeografico { get; set; } = null!;
// La agrupación que obtiene la banca
public string AgrupacionPoliticaId { get; set; } = null!;
[ForeignKey("AgrupacionPoliticaId")]
public AgrupacionPolitica AgrupacionPolitica { get; set; } = null!;
// Cantidad de bancas obtenidas
public int NroBancas { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elecciones.Database.Entities;
public class ResumenVoto
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
// El ámbito donde se resume (siempre provincial en este caso)
public int AmbitoGeograficoId { get; set; }
public string AgrupacionPoliticaId { get; set; } = null!;
public long Votos { get; set; }
public decimal VotosPorcentaje { get; set; }
}

View File

@@ -0,0 +1,21 @@
// src/Elecciones.Database/Entities/Telegrama.cs
using System.ComponentModel.DataAnnotations;
namespace Elecciones.Database.Entities;
public class Telegrama
{
// El ID único del telegrama (ej. "0202600060X") será nuestra Primary Key.
[Key]
public string Id { get; set; } = null!;
// En qué ámbito fue escrutado
public int AmbitoGeograficoId { get; set; }
// El contenido del telegrama en Base64
public string ContenidoBase64 { get; set; } = null!;
public DateTime FechaEscaneo { get; set; }
public DateTime FechaTotalizacion { get; set; }
}

View File

@@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Elecciones.Database.Migrations
{
[DbContext(typeof(EleccionesDbContext))]
[Migration("20250814161142_InitialCreate")]
partial class InitialCreate
[Migration("20250815181913_InitialSchema")]
partial class InitialSchema
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -126,6 +126,63 @@ namespace Elecciones.Database.Migrations
b.ToTable("EstadosRecuentos");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuentoGeneral", b =>
{
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<int>("CantidadElectores")
.HasColumnType("int");
b.Property<int>("CantidadVotantes")
.HasColumnType("int");
b.Property<int>("MesasEsperadas")
.HasColumnType("int");
b.Property<int>("MesasTotalizadas")
.HasColumnType("int");
b.Property<decimal>("MesasTotalizadasPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property<decimal>("ParticipacionPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("AmbitoGeograficoId");
b.ToTable("EstadosRecuentosGenerales");
});
modelBuilder.Entity("Elecciones.Database.Entities.ProyeccionBanca", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AgrupacionPoliticaId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<int>("NroBancas")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AgrupacionPoliticaId");
b.HasIndex("AmbitoGeograficoId");
b.ToTable("ProyeccionesBancas");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResultadoVoto", b =>
{
b.Property<long>("Id")
@@ -154,6 +211,56 @@ namespace Elecciones.Database.Migrations
b.ToTable("ResultadosVotos");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResumenVoto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AgrupacionPoliticaId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<long>("Votos")
.HasColumnType("bigint");
b.Property<decimal>("VotosPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("Id");
b.ToTable("ResumenesVotos");
});
modelBuilder.Entity("Elecciones.Database.Entities.Telegrama", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<string>("ContenidoBase64")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("FechaEscaneo")
.HasColumnType("datetime2");
b.Property<DateTime>("FechaTotalizacion")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("Telegramas");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuento", b =>
{
b.HasOne("Elecciones.Database.Entities.AmbitoGeografico", "AmbitoGeografico")
@@ -165,6 +272,25 @@ namespace Elecciones.Database.Migrations
b.Navigation("AmbitoGeografico");
});
modelBuilder.Entity("Elecciones.Database.Entities.ProyeccionBanca", b =>
{
b.HasOne("Elecciones.Database.Entities.AgrupacionPolitica", "AgrupacionPolitica")
.WithMany()
.HasForeignKey("AgrupacionPoliticaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Elecciones.Database.Entities.AmbitoGeografico", "AmbitoGeografico")
.WithMany()
.HasForeignKey("AmbitoGeograficoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AgrupacionPolitica");
b.Navigation("AmbitoGeografico");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResultadoVoto", b =>
{
b.HasOne("Elecciones.Database.Entities.AgrupacionPolitica", "AgrupacionPolitica")

View File

@@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Elecciones.Database.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
public partial class InitialSchema : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -45,6 +45,54 @@ namespace Elecciones.Database.Migrations
table.PrimaryKey("PK_AmbitosGeograficos", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EstadosRecuentosGenerales",
columns: table => new
{
AmbitoGeograficoId = table.Column<int>(type: "int", nullable: false),
MesasEsperadas = table.Column<int>(type: "int", nullable: false),
MesasTotalizadas = table.Column<int>(type: "int", nullable: false),
MesasTotalizadasPorcentaje = table.Column<decimal>(type: "decimal(5,2)", precision: 5, scale: 2, nullable: false),
CantidadElectores = table.Column<int>(type: "int", nullable: false),
CantidadVotantes = table.Column<int>(type: "int", nullable: false),
ParticipacionPorcentaje = table.Column<decimal>(type: "decimal(5,2)", precision: 5, scale: 2, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EstadosRecuentosGenerales", x => x.AmbitoGeograficoId);
});
migrationBuilder.CreateTable(
name: "ResumenesVotos",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AmbitoGeograficoId = table.Column<int>(type: "int", nullable: false),
AgrupacionPoliticaId = table.Column<string>(type: "nvarchar(max)", nullable: false),
Votos = table.Column<long>(type: "bigint", nullable: false),
VotosPorcentaje = table.Column<decimal>(type: "decimal(5,2)", precision: 5, scale: 2, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ResumenesVotos", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Telegramas",
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
AmbitoGeograficoId = table.Column<int>(type: "int", nullable: false),
ContenidoBase64 = table.Column<string>(type: "nvarchar(max)", nullable: false),
FechaEscaneo = table.Column<DateTime>(type: "datetime2", nullable: false),
FechaTotalizacion = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Telegramas", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EstadosRecuentos",
columns: table => new
@@ -72,6 +120,33 @@ namespace Elecciones.Database.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ProyeccionesBancas",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AmbitoGeograficoId = table.Column<int>(type: "int", nullable: false),
AgrupacionPoliticaId = table.Column<string>(type: "nvarchar(450)", nullable: false),
NroBancas = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProyeccionesBancas", x => x.Id);
table.ForeignKey(
name: "FK_ProyeccionesBancas_AgrupacionesPoliticas_AgrupacionPoliticaId",
column: x => x.AgrupacionPoliticaId,
principalTable: "AgrupacionesPoliticas",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProyeccionesBancas_AmbitosGeograficos_AmbitoGeograficoId",
column: x => x.AmbitoGeograficoId,
principalTable: "AmbitosGeograficos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ResultadosVotos",
columns: table => new
@@ -99,6 +174,16 @@ namespace Elecciones.Database.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ProyeccionesBancas_AgrupacionPoliticaId",
table: "ProyeccionesBancas",
column: "AgrupacionPoliticaId");
migrationBuilder.CreateIndex(
name: "IX_ProyeccionesBancas_AmbitoGeograficoId",
table: "ProyeccionesBancas",
column: "AmbitoGeograficoId");
migrationBuilder.CreateIndex(
name: "IX_ResultadosVotos_AgrupacionPoliticaId",
table: "ResultadosVotos",
@@ -117,9 +202,21 @@ namespace Elecciones.Database.Migrations
migrationBuilder.DropTable(
name: "EstadosRecuentos");
migrationBuilder.DropTable(
name: "EstadosRecuentosGenerales");
migrationBuilder.DropTable(
name: "ProyeccionesBancas");
migrationBuilder.DropTable(
name: "ResultadosVotos");
migrationBuilder.DropTable(
name: "ResumenesVotos");
migrationBuilder.DropTable(
name: "Telegramas");
migrationBuilder.DropTable(
name: "AgrupacionesPoliticas");

View File

@@ -0,0 +1,332 @@
// <auto-generated />
using System;
using Elecciones.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Elecciones.Database.Migrations
{
[DbContext(typeof(EleccionesDbContext))]
[Migration("20250815183610_AddCategoriasElectorales")]
partial class AddCategoriasElectorales
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Elecciones.Database.Entities.AgrupacionPolitica", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("IdTelegrama")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Nombre")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("AgrupacionesPoliticas");
});
modelBuilder.Entity("Elecciones.Database.Entities.AmbitoGeografico", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("CircuitoId")
.HasColumnType("nvarchar(max)");
b.Property<string>("DistritoId")
.HasColumnType("nvarchar(max)");
b.Property<string>("EstablecimientoId")
.HasColumnType("nvarchar(max)");
b.Property<string>("MesaId")
.HasColumnType("nvarchar(max)");
b.Property<string>("MunicipioId")
.HasColumnType("nvarchar(max)");
b.Property<int>("NivelId")
.HasColumnType("int");
b.Property<string>("Nombre")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SeccionId")
.HasColumnType("nvarchar(max)");
b.Property<string>("SeccionProvincialId")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("AmbitosGeograficos");
});
modelBuilder.Entity("Elecciones.Database.Entities.CategoriaElectoral", b =>
{
b.Property<int>("Id")
.HasColumnType("int");
b.Property<string>("Nombre")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Orden")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("CategoriasElectorales");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuento", b =>
{
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<int>("CantidadElectores")
.HasColumnType("int");
b.Property<int>("CantidadVotantes")
.HasColumnType("int");
b.Property<DateTime>("FechaTotalizacion")
.HasColumnType("datetime2");
b.Property<int>("MesasEsperadas")
.HasColumnType("int");
b.Property<int>("MesasTotalizadas")
.HasColumnType("int");
b.Property<decimal>("MesasTotalizadasPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property<decimal>("ParticipacionPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property<long>("VotosEnBlanco")
.HasColumnType("bigint");
b.Property<long>("VotosNulos")
.HasColumnType("bigint");
b.Property<long>("VotosRecurridos")
.HasColumnType("bigint");
b.HasKey("AmbitoGeograficoId");
b.ToTable("EstadosRecuentos");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuentoGeneral", b =>
{
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<int>("CantidadElectores")
.HasColumnType("int");
b.Property<int>("CantidadVotantes")
.HasColumnType("int");
b.Property<int>("MesasEsperadas")
.HasColumnType("int");
b.Property<int>("MesasTotalizadas")
.HasColumnType("int");
b.Property<decimal>("MesasTotalizadasPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property<decimal>("ParticipacionPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("AmbitoGeograficoId");
b.ToTable("EstadosRecuentosGenerales");
});
modelBuilder.Entity("Elecciones.Database.Entities.ProyeccionBanca", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AgrupacionPoliticaId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<int>("NroBancas")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AgrupacionPoliticaId");
b.HasIndex("AmbitoGeograficoId");
b.ToTable("ProyeccionesBancas");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResultadoVoto", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
b.Property<string>("AgrupacionPoliticaId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<long>("CantidadVotos")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("AgrupacionPoliticaId");
b.HasIndex("AmbitoGeograficoId", "AgrupacionPoliticaId")
.IsUnique();
b.ToTable("ResultadosVotos");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResumenVoto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AgrupacionPoliticaId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<long>("Votos")
.HasColumnType("bigint");
b.Property<decimal>("VotosPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("Id");
b.ToTable("ResumenesVotos");
});
modelBuilder.Entity("Elecciones.Database.Entities.Telegrama", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<string>("ContenidoBase64")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("FechaEscaneo")
.HasColumnType("datetime2");
b.Property<DateTime>("FechaTotalizacion")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("Telegramas");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuento", b =>
{
b.HasOne("Elecciones.Database.Entities.AmbitoGeografico", "AmbitoGeografico")
.WithMany()
.HasForeignKey("AmbitoGeograficoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AmbitoGeografico");
});
modelBuilder.Entity("Elecciones.Database.Entities.ProyeccionBanca", b =>
{
b.HasOne("Elecciones.Database.Entities.AgrupacionPolitica", "AgrupacionPolitica")
.WithMany()
.HasForeignKey("AgrupacionPoliticaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Elecciones.Database.Entities.AmbitoGeografico", "AmbitoGeografico")
.WithMany()
.HasForeignKey("AmbitoGeograficoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AgrupacionPolitica");
b.Navigation("AmbitoGeografico");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResultadoVoto", b =>
{
b.HasOne("Elecciones.Database.Entities.AgrupacionPolitica", "AgrupacionPolitica")
.WithMany()
.HasForeignKey("AgrupacionPoliticaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Elecciones.Database.Entities.AmbitoGeografico", "AmbitoGeografico")
.WithMany()
.HasForeignKey("AmbitoGeograficoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AgrupacionPolitica");
b.Navigation("AmbitoGeografico");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,34 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Elecciones.Database.Migrations
{
/// <inheritdoc />
public partial class AddCategoriasElectorales : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CategoriasElectorales",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false),
Nombre = table.Column<string>(type: "nvarchar(max)", nullable: false),
Orden = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CategoriasElectorales", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CategoriasElectorales");
}
}
}

View File

@@ -81,6 +81,23 @@ namespace Elecciones.Database.Migrations
b.ToTable("AmbitosGeograficos");
});
modelBuilder.Entity("Elecciones.Database.Entities.CategoriaElectoral", b =>
{
b.Property<int>("Id")
.HasColumnType("int");
b.Property<string>("Nombre")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Orden")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("CategoriasElectorales");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuento", b =>
{
b.Property<int>("AmbitoGeograficoId")
@@ -123,6 +140,63 @@ namespace Elecciones.Database.Migrations
b.ToTable("EstadosRecuentos");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuentoGeneral", b =>
{
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<int>("CantidadElectores")
.HasColumnType("int");
b.Property<int>("CantidadVotantes")
.HasColumnType("int");
b.Property<int>("MesasEsperadas")
.HasColumnType("int");
b.Property<int>("MesasTotalizadas")
.HasColumnType("int");
b.Property<decimal>("MesasTotalizadasPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property<decimal>("ParticipacionPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("AmbitoGeograficoId");
b.ToTable("EstadosRecuentosGenerales");
});
modelBuilder.Entity("Elecciones.Database.Entities.ProyeccionBanca", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AgrupacionPoliticaId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<int>("NroBancas")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AgrupacionPoliticaId");
b.HasIndex("AmbitoGeograficoId");
b.ToTable("ProyeccionesBancas");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResultadoVoto", b =>
{
b.Property<long>("Id")
@@ -151,6 +225,56 @@ namespace Elecciones.Database.Migrations
b.ToTable("ResultadosVotos");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResumenVoto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AgrupacionPoliticaId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<long>("Votos")
.HasColumnType("bigint");
b.Property<decimal>("VotosPorcentaje")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("Id");
b.ToTable("ResumenesVotos");
});
modelBuilder.Entity("Elecciones.Database.Entities.Telegrama", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AmbitoGeograficoId")
.HasColumnType("int");
b.Property<string>("ContenidoBase64")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("FechaEscaneo")
.HasColumnType("datetime2");
b.Property<DateTime>("FechaTotalizacion")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("Telegramas");
});
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuento", b =>
{
b.HasOne("Elecciones.Database.Entities.AmbitoGeografico", "AmbitoGeografico")
@@ -162,6 +286,25 @@ namespace Elecciones.Database.Migrations
b.Navigation("AmbitoGeografico");
});
modelBuilder.Entity("Elecciones.Database.Entities.ProyeccionBanca", b =>
{
b.HasOne("Elecciones.Database.Entities.AgrupacionPolitica", "AgrupacionPolitica")
.WithMany()
.HasForeignKey("AgrupacionPoliticaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Elecciones.Database.Entities.AmbitoGeografico", "AmbitoGeografico")
.WithMany()
.HasForeignKey("AmbitoGeograficoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AgrupacionPolitica");
b.Navigation("AmbitoGeografico");
});
modelBuilder.Entity("Elecciones.Database.Entities.ResultadoVoto", b =>
{
b.HasOne("Elecciones.Database.Entities.AgrupacionPolitica", "AgrupacionPolitica")

View File

@@ -0,0 +1,14 @@
{
"runtimeOptions": {
"tfm": "net9.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "9.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b90baadeedb870b5b1c9eeeb7022a0d211b61bec")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+39b1e9707275ed59ac4a7d32e26b951186a346bb")]
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+39b1e9707275ed59ac4a7d32e26b951186a346bb")]
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generado por la clase WriteCodeFragment de MSBuild.

View File

@@ -0,0 +1,23 @@
is_global = true
build_property.TargetFramework = net9.0
build_property.TargetFramework = net9.0
build_property.TargetPlatformMinVersion =
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Elecciones.Database
build_property.ProjectDir = E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 9.0
build_property.EnableCodeStyleSeverity =

View File

@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@@ -0,0 +1,14 @@
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\bin\Release\net9.0\Elecciones.Database.deps.json
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\bin\Release\net9.0\Elecciones.Database.runtimeconfig.json
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\bin\Release\net9.0\Elecciones.Database.dll
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\bin\Release\net9.0\Elecciones.Database.pdb
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.csproj.AssemblyReference.cache
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.GeneratedMSBuildEditorConfig.editorconfig
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.AssemblyInfoInputs.cache
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.AssemblyInfo.cs
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.csproj.CoreCompileInputs.cache
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.dll
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\refint\Elecciones.Database.dll
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.pdb
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\Elecciones.Database.genruntimeconfig.cache
E:\Elecciones-2025\Elecciones-Web\src\Elecciones.Database\obj\Release\net9.0\ref\Elecciones.Database.dll