Feats y Fixs Varios
This commit is contained in:
@@ -4,7 +4,7 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|||||||
import { getBancadas, getAgrupaciones, updateBancada, type UpdateBancadaData } from '../services/apiService';
|
import { getBancadas, getAgrupaciones, updateBancada, type UpdateBancadaData } from '../services/apiService';
|
||||||
import type { Bancada, AgrupacionPolitica } from '../types';
|
import type { Bancada, AgrupacionPolitica } from '../types';
|
||||||
import { OcupantesModal } from './OcupantesModal';
|
import { OcupantesModal } from './OcupantesModal';
|
||||||
import './AgrupacionesManager.css'; // Asegúrate de que este CSS tenga los estilos de .chamber-tabs
|
import './AgrupacionesManager.css';
|
||||||
|
|
||||||
const camaras = ['diputados', 'senadores'] as const;
|
const camaras = ['diputados', 'senadores'] as const;
|
||||||
|
|
||||||
@@ -14,13 +14,11 @@ export const BancasManager = () => {
|
|||||||
const [bancadaSeleccionada, setBancadaSeleccionada] = useState<Bancada | null>(null);
|
const [bancadaSeleccionada, setBancadaSeleccionada] = useState<Bancada | null>(null);
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
// Obtenemos todas las agrupaciones para poblar el <select>
|
|
||||||
const { data: agrupaciones = [] } = useQuery<AgrupacionPolitica[]>({
|
const { data: agrupaciones = [] } = useQuery<AgrupacionPolitica[]>({
|
||||||
queryKey: ['agrupaciones'],
|
queryKey: ['agrupaciones'],
|
||||||
queryFn: getAgrupaciones
|
queryFn: getAgrupaciones
|
||||||
});
|
});
|
||||||
|
|
||||||
// Obtenemos las bancas para la cámara activa (diputados o senadores)
|
|
||||||
const { data: bancadas = [], isLoading, error } = useQuery<Bancada[]>({
|
const { data: bancadas = [], isLoading, error } = useQuery<Bancada[]>({
|
||||||
queryKey: ['bancadas', activeTab],
|
queryKey: ['bancadas', activeTab],
|
||||||
queryFn: () => getBancadas(activeTab),
|
queryFn: () => getBancadas(activeTab),
|
||||||
@@ -40,10 +38,9 @@ export const BancasManager = () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await updateBancada(bancadaId, payload);
|
await updateBancada(bancadaId, payload);
|
||||||
// Invalida la query para forzar una recarga de datos frescos desde el servidor
|
|
||||||
queryClient.invalidateQueries({ queryKey: ['bancadas', activeTab] });
|
queryClient.invalidateQueries({ queryKey: ['bancadas', activeTab] });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert("Error al guardar el cambio.");
|
alert("Error al guardar el cambio de agrupación.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -57,7 +54,7 @@ export const BancasManager = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="admin-module">
|
<div className="admin-module">
|
||||||
<h2>Gestión de Ocupación de Bancas</h2>
|
<h2>Gestión de Ocupación de Bancas</h2>
|
||||||
<p>Asigne a cada banca un partido político y, opcionalmente, los datos de la persona que la ocupa.</p>
|
<p>Asigne a cada banca física un partido político y, opcionalmente, los datos de la persona que la ocupa.</p>
|
||||||
|
|
||||||
<div className="chamber-tabs">
|
<div className="chamber-tabs">
|
||||||
{camaras.map(camara => (
|
{camaras.map(camara => (
|
||||||
@@ -75,16 +72,25 @@ export const BancasManager = () => {
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Banca #</th>
|
<th style={{ width: '15%' }}>Banca #</th>
|
||||||
<th>Partido Asignado</th>
|
<th style={{ width: '35%' }}>Partido Asignado</th>
|
||||||
<th>Ocupante Actual</th>
|
<th style={{ width: '30%' }}>Ocupante Actual</th>
|
||||||
<th>Acciones</th>
|
<th style={{ width: '20%' }}>Acciones</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{bancadas.map((bancada, index) => (
|
{bancadas.map((bancada) => (
|
||||||
<tr key={bancada.id}>
|
<tr key={bancada.id}>
|
||||||
<td>{`${activeTab.charAt(0).toUpperCase()}-${index + 1}`}</td>
|
{/* Usamos el NumeroBanca para la etiqueta visual */}
|
||||||
|
<td>
|
||||||
|
{`${activeTab.charAt(0).toUpperCase()}-${bancada.numeroBanca}`}
|
||||||
|
{((activeTab === 'diputados' && bancada.numeroBanca === 92) ||
|
||||||
|
(activeTab === 'senadores' && bancada.numeroBanca === 46)) && (
|
||||||
|
<span style={{ marginLeft: '8px', fontSize: '0.8em', color: '#666', fontStyle: 'italic' }}>
|
||||||
|
(Presidencia)
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select
|
<select
|
||||||
value={bancada.agrupacionPoliticaId || ''}
|
value={bancada.agrupacionPoliticaId || ''}
|
||||||
@@ -97,6 +103,7 @@ export const BancasManager = () => {
|
|||||||
<td>{bancada.ocupante?.nombreOcupante || 'Sin asignar'}</td>
|
<td>{bancada.ocupante?.nombreOcupante || 'Sin asignar'}</td>
|
||||||
<td>
|
<td>
|
||||||
<button
|
<button
|
||||||
|
// El botón se habilita solo si hay un partido asignado a la banca
|
||||||
disabled={!bancada.agrupacionPoliticaId}
|
disabled={!bancada.agrupacionPoliticaId}
|
||||||
onClick={() => handleOpenModal(bancada)}
|
onClick={() => handleOpenModal(bancada)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ export const DashboardPage = () => {
|
|||||||
<button onClick={logout}>Cerrar Sesión</button>
|
<button onClick={logout}>Cerrar Sesión</button>
|
||||||
</header>
|
</header>
|
||||||
<main style={{ marginTop: '2rem' }}>
|
<main style={{ marginTop: '2rem' }}>
|
||||||
<ConfiguracionGeneral />
|
|
||||||
<AgrupacionesManager />
|
<AgrupacionesManager />
|
||||||
|
|
||||||
<div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap', marginTop: '2rem' }}>
|
<div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap', marginTop: '2rem' }}>
|
||||||
<div style={{ flex: '1 1 400px' }}>
|
<div style={{ flex: '1 1 400px' }}>
|
||||||
<OrdenDiputadosManager />
|
<OrdenDiputadosManager />
|
||||||
@@ -27,6 +25,7 @@ export const DashboardPage = () => {
|
|||||||
<OrdenSenadoresManager />
|
<OrdenSenadoresManager />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ConfiguracionGeneral />
|
||||||
<BancasManager />
|
<BancasManager />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export interface OcupanteBanca {
|
|||||||
export interface Bancada {
|
export interface Bancada {
|
||||||
id: number;
|
id: number;
|
||||||
camara: TipoCamaraValue;
|
camara: TipoCamaraValue;
|
||||||
|
numeroBanca: number;
|
||||||
agrupacionPoliticaId: string | null;
|
agrupacionPoliticaId: string | null;
|
||||||
agrupacionPolitica: AgrupacionPolitica | null;
|
agrupacionPolitica: AgrupacionPolitica | null;
|
||||||
ocupante: OcupanteBanca | null;
|
ocupante: OcupanteBanca | null;
|
||||||
|
|||||||
BIN
Elecciones-Web/frontend/public/default-avatar.png
Normal file
BIN
Elecciones-Web/frontend/public/default-avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -42,6 +42,7 @@ interface PartidoData {
|
|||||||
export interface BancadaDetalle {
|
export interface BancadaDetalle {
|
||||||
id: number; // Este es el ID de la Bancada
|
id: number; // Este es el ID de la Bancada
|
||||||
camara: number; // 0 o 1
|
camara: number; // 0 o 1
|
||||||
|
numeroBanca: number;
|
||||||
agrupacionPoliticaId: string | null;
|
agrupacionPoliticaId: string | null;
|
||||||
ocupante: OcupanteBanca | null;
|
ocupante: OcupanteBanca | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,3 +202,8 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#seat-tooltip.react-tooltip {
|
||||||
|
opacity: 1 !important;
|
||||||
|
background-color: white; /* Opcional: asegura un fondo sólido */
|
||||||
|
}
|
||||||
@@ -29,44 +29,44 @@ export const CongresoWidget = () => {
|
|||||||
|
|
||||||
const datosCamaraActual = composicionData ? composicionData[camaraActiva] : null;
|
const datosCamaraActual = composicionData ? composicionData[camaraActiva] : null;
|
||||||
|
|
||||||
|
const esModoOficial = bancadasDetalle.length > 0;
|
||||||
|
|
||||||
// --- LÓGICA DE SEATFILLDATA ---
|
// --- LÓGICA DE SEATFILLDATA ---
|
||||||
const seatFillData = useMemo(() => {
|
const seatFillData = useMemo(() => {
|
||||||
if (!datosCamaraActual) return [];
|
if (!datosCamaraActual) return [];
|
||||||
|
|
||||||
// --- LÓGICA DEL INTERRUPTOR ---
|
if (esModoOficial) {
|
||||||
// Verificamos si la respuesta de la API contiene datos de ocupantes.
|
// --- MODO OFICIAL ---
|
||||||
// Si bancadasDetalle tiene elementos, significa que el modo "Oficial" está activo en el backend.
|
|
||||||
const modoOficialActivo = bancadasDetalle.length > 0;
|
|
||||||
|
|
||||||
if (modoOficialActivo) {
|
|
||||||
// --- MODO OFICIAL: Construir desde las bancas físicas ---
|
|
||||||
const camaraId = camaraActiva === 'diputados' ? 0 : 1;
|
const camaraId = camaraActiva === 'diputados' ? 0 : 1;
|
||||||
const bancadasDeCamara = bancadasDetalle.filter(b => b.camara === camaraId);
|
const bancadasDeCamara = bancadasDetalle.filter(b => b.camara === camaraId);
|
||||||
|
|
||||||
const colorMap = new Map<string, string>();
|
const colorMap = new Map<string, string>();
|
||||||
datosCamaraActual.partidos.forEach(p => {
|
datosCamaraActual.partidos.forEach(p => { if (p.id && p.color) colorMap.set(p.id, p.color); });
|
||||||
if (p.id && p.color) {
|
|
||||||
colorMap.set(p.id, p.color);
|
// 1. Creamos un array del tamaño correcto, lleno de 'null's
|
||||||
|
const size = camaraActiva === 'diputados' ? 92 : 46;
|
||||||
|
const finalSeatData = new Array(size).fill(null);
|
||||||
|
|
||||||
|
// 2. Poblamos el array usando NumeroBanca como índice
|
||||||
|
bancadasDeCamara.forEach(bancada => {
|
||||||
|
// El índice del SVG es NumeroBanca - 1
|
||||||
|
const index = bancada.numeroBanca - 1;
|
||||||
|
if (index >= 0 && index < size) {
|
||||||
|
finalSeatData[index] = {
|
||||||
|
color: bancada.agrupacionPoliticaId ? colorMap.get(bancada.agrupacionPoliticaId) || DEFAULT_COLOR : DEFAULT_COLOR,
|
||||||
|
ocupante: bancada.ocupante
|
||||||
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const bancadasOrdenadas = bancadasDeCamara.sort((a, b) => a.id - b.id);
|
return finalSeatData;
|
||||||
|
|
||||||
return bancadasOrdenadas.map(bancada => ({
|
|
||||||
color: bancada.agrupacionPoliticaId ? colorMap.get(bancada.agrupacionPoliticaId) || DEFAULT_COLOR : DEFAULT_COLOR,
|
|
||||||
ocupante: bancada.ocupante
|
|
||||||
}));
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// --- MODO PROYECCIÓN: Construir desde los totales de los partidos ---
|
// --- MODO PROYECCIÓN ---
|
||||||
// Esta es la lógica original que teníamos para el modo proyección.
|
|
||||||
return datosCamaraActual.partidos.flatMap(party => {
|
return datosCamaraActual.partidos.flatMap(party => {
|
||||||
const seatColor = party.color || DEFAULT_COLOR;
|
const seatColor = party.color || DEFAULT_COLOR;
|
||||||
// En modo proyección, no hay ocupantes individuales.
|
|
||||||
return Array(party.bancasTotales).fill({ color: seatColor, ocupante: null });
|
return Array(party.bancasTotales).fill({ color: seatColor, ocupante: null });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [datosCamaraActual, bancadasDetalle, camaraActiva]);
|
}, [datosCamaraActual, bancadasDetalle, camaraActiva]);
|
||||||
|
|
||||||
if (isLoadingComposicion) return <div className="congreso-container loading">Cargando...</div>;
|
if (isLoadingComposicion) return <div className="congreso-container loading">Cargando...</div>;
|
||||||
@@ -78,11 +78,23 @@ export const CongresoWidget = () => {
|
|||||||
<div className="congreso-container">
|
<div className="congreso-container">
|
||||||
<div className="congreso-grafico">
|
<div className="congreso-grafico">
|
||||||
{camaraActiva === 'diputados' ? (
|
{camaraActiva === 'diputados' ? (
|
||||||
<ParliamentLayout seatData={seatFillData} presidenteBancada={datosCamaraActual.presidenteBancada} />
|
<ParliamentLayout
|
||||||
|
seatData={seatFillData}
|
||||||
|
// --- INICIO DE LA CORRECCIÓN ---
|
||||||
|
// Solo pasamos la prop 'presidenteBancada' si NO estamos en modo oficial
|
||||||
|
presidenteBancada={!esModoOficial ? datosCamaraActual.presidenteBancada : undefined}
|
||||||
|
// --- FIN DE LA CORRECCIÓN ---
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<SenateLayout seatData={seatFillData} presidenteBancada={datosCamaraActual.presidenteBancada} />
|
<SenateLayout
|
||||||
|
seatData={seatFillData}
|
||||||
|
// --- INICIO DE LA CORRECCIÓN ---
|
||||||
|
presidenteBancada={!esModoOficial ? datosCamaraActual.presidenteBancada : undefined}
|
||||||
|
// --- FIN DE LA CORRECCIÓN ---
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="congreso-summary">
|
<div className="congreso-summary">
|
||||||
<div className="chamber-tabs">
|
<div className="chamber-tabs">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// src/components/ParliamentLayout.tsx
|
// src/components/ParliamentLayout.tsx
|
||||||
import React from 'react';
|
import React, { useLayoutEffect } from 'react';
|
||||||
|
import { handleImageFallback } from './imageFallback';
|
||||||
|
|
||||||
// Interfaces (no cambian)
|
// Interfaces (no cambian)
|
||||||
interface SeatFillData {
|
interface SeatFillData {
|
||||||
@@ -14,7 +15,7 @@ interface SeatFillData {
|
|||||||
interface ParliamentLayoutProps {
|
interface ParliamentLayoutProps {
|
||||||
seatData: SeatFillData[];
|
seatData: SeatFillData[];
|
||||||
size?: number;
|
size?: number;
|
||||||
presidenteBancada: { color: string | null } | null;
|
presidenteBancada?: { color: string | null } | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PRESIDENTE_SEAT_INDEX = 91;
|
const PRESIDENTE_SEAT_INDEX = 91;
|
||||||
@@ -24,9 +25,14 @@ export const ParliamentLayout: React.FC<ParliamentLayoutProps> = ({
|
|||||||
size = 400,
|
size = 400,
|
||||||
presidenteBancada,
|
presidenteBancada,
|
||||||
}) => {
|
}) => {
|
||||||
|
// HOOK DE IMAGENES POR DEFECTO
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
// Se ejecuta después de que el componente y el tooltip se hayan renderizado
|
||||||
|
handleImageFallback('.seat-tooltip img', '/default-avatar.png');
|
||||||
|
}, [seatData, presidenteBancada]); // Dependencias: se vuelve a ejecutar si estos datos cambian
|
||||||
const uniqueColors = [...new Set(seatData.map(d => d.color))];
|
const uniqueColors = [...new Set(seatData.map(d => d.color))];
|
||||||
|
|
||||||
// --- NUEVO ARRAY DE ELEMENTOS ORDENADO ---
|
// --- ARRAY DE ELEMENTOS ORDENADO ---
|
||||||
const seatElements = [
|
const seatElements = [
|
||||||
<circle key="seat-0" id="seat-0" r="12" cy="268.306" cx="202.26" transform="matrix(-0.632908, 0.774227, 0.774227, 0.632908, 0, 0)" />,
|
<circle key="seat-0" id="seat-0" r="12" cy="268.306" cx="202.26" transform="matrix(-0.632908, 0.774227, 0.774227, 0.632908, 0, 0)" />,
|
||||||
<circle key="seat-1" id="seat-1" r="12" cy="214.247" cx="223.62" transform="matrix(-0.632908, 0.774227, 0.774227, 0.632908, 0, 0)" />,
|
<circle key="seat-1" id="seat-1" r="12" cy="214.247" cx="223.62" transform="matrix(-0.632908, 0.774227, 0.774227, 0.632908, 0, 0)" />,
|
||||||
@@ -135,14 +141,12 @@ export const ParliamentLayout: React.FC<ParliamentLayoutProps> = ({
|
|||||||
|
|
||||||
const renderedElements = seatElements.map((child, index) => {
|
const renderedElements = seatElements.map((child, index) => {
|
||||||
// --- CASO ESPECIAL: ASIENTO PRESIDENCIAL ---
|
// --- CASO ESPECIAL: ASIENTO PRESIDENCIAL ---
|
||||||
if (index === PRESIDENTE_SEAT_INDEX) {
|
if (presidenteBancada && index === PRESIDENTE_SEAT_INDEX) {
|
||||||
return React.cloneElement(child, {
|
return React.cloneElement(child, {
|
||||||
fill: presidenteBancada?.color || '#A9A9A9',
|
fill: presidenteBancada.color || '#A9A9A9',
|
||||||
stroke: '#000000',
|
stroke: '#000000',
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
// Le damos un tooltip genérico al presidente
|
'data-tooltip-id': 'seat-tooltip'
|
||||||
'data-tooltip-id': 'seat-tooltip',
|
|
||||||
'data-tooltip-html': `<div class="seat-tooltip"><p>Presidencia de la Cámara</p></div>`
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// src/components/SenateLayout.tsx
|
// src/components/SenateLayout.tsx
|
||||||
import React from 'react';
|
import React, { useLayoutEffect } from 'react';
|
||||||
|
import { handleImageFallback } from './imageFallback';
|
||||||
|
|
||||||
// Interfaces
|
// Interfaces
|
||||||
interface SeatFillData {
|
interface SeatFillData {
|
||||||
@@ -14,7 +15,7 @@ interface SeatFillData {
|
|||||||
interface SenateLayoutProps {
|
interface SenateLayoutProps {
|
||||||
seatData: SeatFillData[];
|
seatData: SeatFillData[];
|
||||||
size?: number;
|
size?: number;
|
||||||
presidenteBancada: { color: string | null } | null;
|
presidenteBancada?: { color: string | null } | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PRESIDENTE_SEAT_INDEX = 45; // El último asiento (índice 45 de 46)
|
const PRESIDENTE_SEAT_INDEX = 45; // El último asiento (índice 45 de 46)
|
||||||
@@ -24,6 +25,12 @@ export const SenateLayout: React.FC<SenateLayoutProps> = ({
|
|||||||
size = 400,
|
size = 400,
|
||||||
presidenteBancada,
|
presidenteBancada,
|
||||||
}) => {
|
}) => {
|
||||||
|
// HOOK DE IMAGENES POR DEFECTO
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
// Se ejecuta después de que el componente y el tooltip se hayan renderizado
|
||||||
|
handleImageFallback('.seat-tooltip img', '/default-avatar.png');
|
||||||
|
}, [seatData, presidenteBancada]); // Dependencias: se vuelve a ejecutar si estos datos cambian
|
||||||
|
|
||||||
const uniqueColors = [...new Set(seatData.map(d => d.color).filter(Boolean))];
|
const uniqueColors = [...new Set(seatData.map(d => d.color).filter(Boolean))];
|
||||||
|
|
||||||
// --- NUEVO ARRAY DE ELEMENTOS ORDENADO PARA EL SENADO ---
|
// --- NUEVO ARRAY DE ELEMENTOS ORDENADO PARA EL SENADO ---
|
||||||
@@ -89,14 +96,12 @@ export const SenateLayout: React.FC<SenateLayoutProps> = ({
|
|||||||
|
|
||||||
const renderedElements = seatElements.map((child, index) => {
|
const renderedElements = seatElements.map((child, index) => {
|
||||||
// --- CASO ESPECIAL: ASIENTO PRESIDENCIAL ---
|
// --- CASO ESPECIAL: ASIENTO PRESIDENCIAL ---
|
||||||
if (index === PRESIDENTE_SEAT_INDEX) {
|
if (presidenteBancada && index === PRESIDENTE_SEAT_INDEX) {
|
||||||
return React.cloneElement(child, {
|
return React.cloneElement(child, {
|
||||||
fill: presidenteBancada?.color || '#A9A9A9',
|
fill: presidenteBancada.color || '#A9A9A9',
|
||||||
stroke: '#000000',
|
stroke: '#000000',
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
// Le damos un tooltip genérico al presidente
|
'data-tooltip-id': 'seat-tooltip'
|
||||||
'data-tooltip-id': 'seat-tooltip',
|
|
||||||
'data-tooltip-html': `<div class="seat-tooltip"><p>Presidencia de la Cámara</p></div>`
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13
Elecciones-Web/frontend/src/components/imageFallback.ts
Normal file
13
Elecciones-Web/frontend/src/components/imageFallback.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// src/components/imageFallback.ts
|
||||||
|
|
||||||
|
export function handleImageFallback(selector: string, fallbackImageUrl: string) {
|
||||||
|
// Le decimos a TypeScript que el resultado será una lista de elementos de imagen HTML
|
||||||
|
const images: NodeListOf<HTMLImageElement> = document.querySelectorAll(selector);
|
||||||
|
|
||||||
|
images.forEach(img => {
|
||||||
|
// Ahora que 'img' es de tipo HTMLImageElement, TypeScript sabe que 'onerror' y 'src' son válidos.
|
||||||
|
img.onerror = () => {
|
||||||
|
img.src = fallbackImageUrl;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -311,19 +311,47 @@ public class ResultadosController : ControllerBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// En ResultadosController.cs
|
||||||
private async Task<IActionResult> GetComposicionDesdeBancadasOficiales(Dictionary<string, string> config)
|
private async Task<IActionResult> GetComposicionDesdeBancadasOficiales(Dictionary<string, string> config)
|
||||||
{
|
{
|
||||||
var bancadas = await _dbContext.Bancadas.AsNoTracking()
|
config.TryGetValue("MostrarOcupantes", out var mostrarOcupantesValue);
|
||||||
.Include(b => b.AgrupacionPolitica)
|
bool mostrarOcupantes = mostrarOcupantesValue == "true";
|
||||||
.Include(b => b.Ocupante)
|
|
||||||
.ToListAsync();
|
IQueryable<Bancada> bancadasQuery = _dbContext.Bancadas.AsNoTracking()
|
||||||
|
.Include(b => b.AgrupacionPolitica);
|
||||||
|
if (mostrarOcupantes)
|
||||||
|
{
|
||||||
|
bancadasQuery = bancadasQuery.Include(b => b.Ocupante);
|
||||||
|
}
|
||||||
|
var bancadas = await bancadasQuery.ToListAsync();
|
||||||
|
|
||||||
var bancasPorAgrupacion = bancadas
|
var bancasPorAgrupacion = bancadas
|
||||||
.Where(b => b.AgrupacionPolitica != null)
|
.Where(b => b.AgrupacionPolitica != null)
|
||||||
.GroupBy(b => b.AgrupacionPolitica)
|
// Agrupamos por el ID del partido, que es un valor único y estable
|
||||||
.Select(g => new { Agrupacion = g.Key!, Camara = g.First().Camara, BancasTotales = g.Count() })
|
.GroupBy(b => b.AgrupacionPolitica!.Id)
|
||||||
|
.Select(g =>
|
||||||
|
{
|
||||||
|
// Tomamos la información de la agrupación del primer elemento (todas son iguales)
|
||||||
|
var primeraBancaDelGrupo = g.First();
|
||||||
|
var agrupacion = primeraBancaDelGrupo.AgrupacionPolitica!;
|
||||||
|
|
||||||
|
// Filtramos los ocupantes solo para este grupo
|
||||||
|
var ocupantesDelPartido = mostrarOcupantes
|
||||||
|
? g.Select(b => b.Ocupante).Where(o => o != null).ToList()
|
||||||
|
: new List<OcupanteBanca?>();
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Agrupacion = agrupacion,
|
||||||
|
Camara = primeraBancaDelGrupo.Camara,
|
||||||
|
BancasTotales = g.Count(),
|
||||||
|
Ocupantes = ocupantesDelPartido
|
||||||
|
};
|
||||||
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
// --- FIN DE LA CORRECCIÓN CLAVE ---
|
||||||
|
|
||||||
var presidenteDiputados = bancasPorAgrupacion
|
var presidenteDiputados = bancasPorAgrupacion
|
||||||
.Where(b => b.Camara == Core.Enums.TipoCamara.Diputados)
|
.Where(b => b.Camara == Core.Enums.TipoCamara.Diputados)
|
||||||
.OrderByDescending(b => b.BancasTotales)
|
.OrderByDescending(b => b.BancasTotales)
|
||||||
@@ -332,43 +360,34 @@ public class ResultadosController : ControllerBase
|
|||||||
config.TryGetValue("PresidenciaSenadores", out var idPartidoPresidenteSenadores);
|
config.TryGetValue("PresidenciaSenadores", out var idPartidoPresidenteSenadores);
|
||||||
var presidenteSenadores = await _dbContext.AgrupacionesPoliticas.FindAsync(idPartidoPresidenteSenadores);
|
var presidenteSenadores = await _dbContext.AgrupacionesPoliticas.FindAsync(idPartidoPresidenteSenadores);
|
||||||
|
|
||||||
object MapearPartidosOficial(Core.Enums.TipoCamara camara)
|
object MapearPartidos(Core.Enums.TipoCamara camara)
|
||||||
{
|
{
|
||||||
// 1. Filtramos las bancadas que nos interesan (por cámara y que tengan partido).
|
|
||||||
var partidosDeCamara = bancasPorAgrupacion.Where(b => b.Camara == camara);
|
var partidosDeCamara = bancasPorAgrupacion.Where(b => b.Camara == camara);
|
||||||
|
|
||||||
// 2. --- ¡EL CAMBIO CLAVE ESTÁ AQUÍ! ---
|
if (camara == Core.Enums.TipoCamara.Diputados)
|
||||||
// Agrupamos por el ID de la Agrupación, no por el objeto.
|
partidosDeCamara = partidosDeCamara.OrderBy(p => p.Agrupacion.OrdenDiputados ?? 999);
|
||||||
// Esto garantiza que todas las bancadas del mismo partido terminen en el MISMO grupo.
|
else
|
||||||
|
partidosDeCamara = partidosDeCamara.OrderBy(p => p.Agrupacion.OrdenSenadores ?? 999);
|
||||||
|
|
||||||
// 3. Ordenamos, como antes, pero ahora sobre una lista de grupos correcta.
|
return partidosDeCamara
|
||||||
var partidosOrdenados = (camara == Core.Enums.TipoCamara.Diputados)
|
.OrderByDescending(p => p.BancasTotales)
|
||||||
? partidosDeCamara.OrderBy(p => p.Agrupacion.OrdenDiputados ?? 999)
|
.Select(p => new
|
||||||
: partidosDeCamara.OrderBy(p => p.Agrupacion.OrdenSenadores ?? 999);
|
{
|
||||||
|
p.Agrupacion.Id,
|
||||||
// 4. Mapeamos al resultado final.
|
p.Agrupacion.Nombre,
|
||||||
return partidosDeCamara.Select(p => new
|
p.Agrupacion.NombreCorto,
|
||||||
{
|
p.Agrupacion.Color,
|
||||||
p.Agrupacion.Id,
|
p.BancasTotales,
|
||||||
p.Agrupacion.Nombre,
|
p.Ocupantes // Pasamos la lista de ocupantes ya filtrada
|
||||||
p.Agrupacion.NombreCorto,
|
}).ToList();
|
||||||
p.Agrupacion.Color,
|
|
||||||
p.BancasTotales,
|
|
||||||
// Adjuntamos la lista de ocupantes para este partido
|
|
||||||
Ocupantes = bancadas
|
|
||||||
.Where(b => b.AgrupacionPoliticaId == p.Agrupacion.Id && b.Camara == p.Camara && b.Ocupante != null)
|
|
||||||
.Select(b => b.Ocupante)
|
|
||||||
.ToList()
|
|
||||||
}).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// El resto del método permanece igual...
|
|
||||||
var diputados = new
|
var diputados = new
|
||||||
{
|
{
|
||||||
CamaraNombre = "Cámara de Diputados",
|
CamaraNombre = "Cámara de Diputados",
|
||||||
TotalBancas = 92,
|
TotalBancas = 92,
|
||||||
BancasEnJuego = 0,
|
BancasEnJuego = 0,
|
||||||
Partidos = MapearPartidosOficial(Core.Enums.TipoCamara.Diputados),
|
Partidos = MapearPartidos(Core.Enums.TipoCamara.Diputados),
|
||||||
PresidenteBancada = presidenteDiputados != null ? new { presidenteDiputados.Color } : null
|
PresidenteBancada = presidenteDiputados != null ? new { presidenteDiputados.Color } : null
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -377,7 +396,7 @@ public class ResultadosController : ControllerBase
|
|||||||
CamaraNombre = "Cámara de Senadores",
|
CamaraNombre = "Cámara de Senadores",
|
||||||
TotalBancas = 46,
|
TotalBancas = 46,
|
||||||
BancasEnJuego = 0,
|
BancasEnJuego = 0,
|
||||||
Partidos = MapearPartidosOficial(Core.Enums.TipoCamara.Senadores),
|
Partidos = MapearPartidos(Core.Enums.TipoCamara.Senadores),
|
||||||
PresidenteBancada = presidenteSenadores != null ? new { presidenteSenadores.Color } : null
|
PresidenteBancada = presidenteSenadores != null ? new { presidenteSenadores.Color } : null
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -471,7 +490,14 @@ public class ResultadosController : ControllerBase
|
|||||||
var bancadasConOcupantes = await _dbContext.Bancadas
|
var bancadasConOcupantes = await _dbContext.Bancadas
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Include(b => b.Ocupante)
|
.Include(b => b.Ocupante)
|
||||||
.Select(b => new { b.Id, b.Camara, b.AgrupacionPoliticaId, Ocupante = b.Ocupante })
|
.Select(b => new
|
||||||
|
{
|
||||||
|
b.Id,
|
||||||
|
b.Camara,
|
||||||
|
b.NumeroBanca,
|
||||||
|
b.AgrupacionPoliticaId,
|
||||||
|
Ocupante = b.Ocupante
|
||||||
|
})
|
||||||
.OrderBy(b => b.Id)
|
.OrderBy(b => b.Id)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|||||||
@@ -107,18 +107,26 @@ using (var scope = app.Services.CreateScope())
|
|||||||
{
|
{
|
||||||
var bancas = new List<Bancada>();
|
var bancas = new List<Bancada>();
|
||||||
// 92 bancas de diputados
|
// 92 bancas de diputados
|
||||||
for (int i = 0; i < 92; i++)
|
for (int i = 1; i <= 92; i++) // Bucle de 1 a 92
|
||||||
{
|
{
|
||||||
bancas.Add(new Bancada { Camara = Elecciones.Core.Enums.TipoCamara.Diputados });
|
bancas.Add(new Bancada
|
||||||
|
{
|
||||||
|
Camara = Elecciones.Core.Enums.TipoCamara.Diputados,
|
||||||
|
NumeroBanca = i // Asignamos el número de banca
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// 46 bancas de senadores
|
// 46 bancas de senadores
|
||||||
for (int i = 0; i < 46; i++)
|
for (int i = 1; i <= 46; i++) // Bucle de 1 a 46
|
||||||
{
|
{
|
||||||
bancas.Add(new Bancada { Camara = Elecciones.Core.Enums.TipoCamara.Senadores });
|
bancas.Add(new Bancada
|
||||||
|
{
|
||||||
|
Camara = Elecciones.Core.Enums.TipoCamara.Senadores,
|
||||||
|
NumeroBanca = i // Asignamos el número de banca
|
||||||
|
});
|
||||||
}
|
}
|
||||||
context.Bancadas.AddRange(bancas);
|
context.Bancadas.AddRange(bancas);
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
Console.WriteLine("--> Seeded 138 empty bancas.");
|
Console.WriteLine("--> Seeded 138 bancas físicas.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Api")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Api")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1ed9a49a5373209c105168d721df4c77b6c1f329")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3b8c6bf754cff6ace486ae8fe850ed4d69233280")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Api")]
|
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Api")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Api")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Api")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"GlobalPropertiesHash":"b5T/+ta4fUd8qpIzUTm3KyEwAYYUsU5ASo+CSFM3ByE=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["BNGxWTPjjFD1Fj56FltRDUvsBzgMlQvuqV\u002BraH2IhwQ=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","ywKm3DCyXg4YCbZAIx3JUlT8N4Irff3GswYUVDST\u002BjQ=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","XNJwPCDHDCECwfNSMw\u002B6U9bmP9Oc1zMcX0NwP0k5bF8=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","T1/vt/jpzUAMkv7\u002BVei1e0uBlnnKJZz40wzx6s2b4L0="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
{"GlobalPropertiesHash":"b5T/+ta4fUd8qpIzUTm3KyEwAYYUsU5ASo+CSFM3ByE=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["BNGxWTPjjFD1Fj56FltRDUvsBzgMlQvuqV\u002BraH2IhwQ=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","ywKm3DCyXg4YCbZAIx3JUlT8N4Irff3GswYUVDST\u002BjQ=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","lHTUEsMkDu8nqXtfTwl7FRfgocyyc7RI5O/edTHN1\u002B0=","BlOQCaw/bt9UsCnDEIqO6LwzwEh4i0OxBfeIZgKDR4U=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","2x9HRdaMF3CjEHo\u002BFx\u002BfhG7CTomq/ExTkOKw2bUeHms="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||||
@@ -1 +1 @@
|
|||||||
{"GlobalPropertiesHash":"tJTBjV/i0Ihkc6XuOu69wxL8PBac9c9Kak6srMso4pU=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["BNGxWTPjjFD1Fj56FltRDUvsBzgMlQvuqV\u002BraH2IhwQ=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","ywKm3DCyXg4YCbZAIx3JUlT8N4Irff3GswYUVDST\u002BjQ=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","XNJwPCDHDCECwfNSMw\u002B6U9bmP9Oc1zMcX0NwP0k5bF8=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","T1/vt/jpzUAMkv7\u002BVei1e0uBlnnKJZz40wzx6s2b4L0="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
{"GlobalPropertiesHash":"tJTBjV/i0Ihkc6XuOu69wxL8PBac9c9Kak6srMso4pU=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["BNGxWTPjjFD1Fj56FltRDUvsBzgMlQvuqV\u002BraH2IhwQ=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","ywKm3DCyXg4YCbZAIx3JUlT8N4Irff3GswYUVDST\u002BjQ=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","lHTUEsMkDu8nqXtfTwl7FRfgocyyc7RI5O/edTHN1\u002B0=","BlOQCaw/bt9UsCnDEIqO6LwzwEh4i0OxBfeIZgKDR4U=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","2x9HRdaMF3CjEHo\u002BFx\u002BfhG7CTomq/ExTkOKw2bUeHms="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Core")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Core")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1ed9a49a5373209c105168d721df4c77b6c1f329")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3b8c6bf754cff6ace486ae8fe850ed4d69233280")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Core")]
|
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Core")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Core")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Core")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public class Bancada
|
|||||||
[Required]
|
[Required]
|
||||||
public TipoCamara Camara { get; set; }
|
public TipoCamara Camara { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public int NumeroBanca { get; set; }
|
||||||
|
|
||||||
public string? AgrupacionPoliticaId { get; set; }
|
public string? AgrupacionPoliticaId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("AgrupacionPoliticaId")]
|
[ForeignKey("AgrupacionPoliticaId")]
|
||||||
|
|||||||
516
Elecciones-Web/src/Elecciones.Database/Migrations/20250830124636_AddNumeroBancaToBancadas.Designer.cs
generated
Normal file
516
Elecciones-Web/src/Elecciones.Database/Migrations/20250830124636_AddNumeroBancaToBancadas.Designer.cs
generated
Normal file
@@ -0,0 +1,516 @@
|
|||||||
|
// <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("20250830124636_AddNumeroBancaToBancadas")]
|
||||||
|
partial class AddNumeroBancaToBancadas
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.UseCollation("Modern_Spanish_CI_AS")
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.8")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Elecciones.Database.Entities.AdminUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordSalt")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("AdminUsers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Elecciones.Database.Entities.AgrupacionPolitica", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<string>("Color")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("IdTelegrama")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("LogoUrl")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Nombre")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("NombreCorto")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int?>("OrdenDiputados")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int?>("OrdenSenadores")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
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.Bancada", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("AgrupacionPoliticaId")
|
||||||
|
.HasColumnType("nvarchar(450)");
|
||||||
|
|
||||||
|
b.Property<int>("Camara")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("NumeroBanca")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("AgrupacionPoliticaId");
|
||||||
|
|
||||||
|
b.ToTable("Bancadas");
|
||||||
|
});
|
||||||
|
|
||||||
|
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.Configuracion", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Clave")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("Valor")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.HasKey("Clave");
|
||||||
|
|
||||||
|
b.ToTable("Configuraciones");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuento", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("AmbitoGeograficoId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("CategoriaId")
|
||||||
|
.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<decimal>("VotosEnBlancoPorcentaje")
|
||||||
|
.HasPrecision(18, 4)
|
||||||
|
.HasColumnType("decimal(18,4)");
|
||||||
|
|
||||||
|
b.Property<long>("VotosNulos")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<decimal>("VotosNulosPorcentaje")
|
||||||
|
.HasPrecision(18, 4)
|
||||||
|
.HasColumnType("decimal(18,4)");
|
||||||
|
|
||||||
|
b.Property<long>("VotosRecurridos")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<decimal>("VotosRecurridosPorcentaje")
|
||||||
|
.HasPrecision(18, 4)
|
||||||
|
.HasColumnType("decimal(18,4)");
|
||||||
|
|
||||||
|
b.HasKey("AmbitoGeograficoId", "CategoriaId");
|
||||||
|
|
||||||
|
b.ToTable("EstadosRecuentos");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Elecciones.Database.Entities.EstadoRecuentoGeneral", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("AmbitoGeograficoId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("CategoriaId")
|
||||||
|
.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.HasKey("AmbitoGeograficoId", "CategoriaId");
|
||||||
|
|
||||||
|
b.HasIndex("CategoriaId");
|
||||||
|
|
||||||
|
b.ToTable("EstadosRecuentosGenerales");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Elecciones.Database.Entities.OcupanteBanca", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("BancadaId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("FotoUrl")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("NombreOcupante")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Periodo")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BancadaId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("OcupantesBancas");
|
||||||
|
});
|
||||||
|
|
||||||
|
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>("CategoriaId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("FechaTotalizacion")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("NroBancas")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("AgrupacionPoliticaId");
|
||||||
|
|
||||||
|
b.HasIndex("AmbitoGeograficoId", "CategoriaId", "AgrupacionPoliticaId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
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.Property<int>("CategoriaId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("PorcentajeVotos")
|
||||||
|
.HasPrecision(18, 4)
|
||||||
|
.HasColumnType("decimal(18,4)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("AgrupacionPoliticaId");
|
||||||
|
|
||||||
|
b.HasIndex("AmbitoGeograficoId", "CategoriaId", "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.Bancada", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Elecciones.Database.Entities.AgrupacionPolitica", "AgrupacionPolitica")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("AgrupacionPoliticaId");
|
||||||
|
|
||||||
|
b.Navigation("AgrupacionPolitica");
|
||||||
|
});
|
||||||
|
|
||||||
|
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.EstadoRecuentoGeneral", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Elecciones.Database.Entities.CategoriaElectoral", "CategoriaElectoral")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CategoriaId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("CategoriaElectoral");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Elecciones.Database.Entities.OcupanteBanca", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Elecciones.Database.Entities.Bancada", "Bancada")
|
||||||
|
.WithOne("Ocupante")
|
||||||
|
.HasForeignKey("Elecciones.Database.Entities.OcupanteBanca", "BancadaId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Bancada");
|
||||||
|
});
|
||||||
|
|
||||||
|
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");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Elecciones.Database.Entities.Bancada", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Ocupante");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Elecciones.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddNumeroBancaToBancadas : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "NumeroBanca",
|
||||||
|
table: "Bancadas",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "NumeroBanca",
|
||||||
|
table: "Bancadas");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -137,6 +137,9 @@ namespace Elecciones.Database.Migrations
|
|||||||
b.Property<int>("Camara")
|
b.Property<int>("Camara")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("NumeroBanca")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("AgrupacionPoliticaId");
|
b.HasIndex("AgrupacionPoliticaId");
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Database")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Database")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1ed9a49a5373209c105168d721df4c77b6c1f329")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3b8c6bf754cff6ace486ae8fe850ed4d69233280")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Database")]
|
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Database")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Database")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Database")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Infrastructure")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Infrastructure")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1ed9a49a5373209c105168d721df4c77b6c1f329")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3b8c6bf754cff6ace486ae8fe850ed4d69233280")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Infrastructure")]
|
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Infrastructure")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Infrastructure")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Infrastructure")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
Reference in New Issue
Block a user