feat(fase3): update sidebar navigation and seed with calendario_fiscal

- Add navigation items for Reportes, Calendario, Alertas, Usuarios
- Add calendario_fiscal table creation in seed
- Insert demo fiscal events for all 12 months

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Consultoria AS
2026-01-22 03:04:25 +00:00
parent 9b8aaea7eb
commit 0c4b1a43a9
2 changed files with 47 additions and 0 deletions

View File

@@ -185,6 +185,45 @@ async function main() {
console.log('✅ Alerts created');
// Create calendario_fiscal table
await prisma.$executeRawUnsafe(`
CREATE TABLE IF NOT EXISTS "${schemaName}"."calendario_fiscal" (
id SERIAL PRIMARY KEY,
titulo VARCHAR(200) NOT NULL,
descripcion TEXT,
tipo VARCHAR(20) NOT NULL,
fecha_limite TIMESTAMP NOT NULL,
recurrencia VARCHAR(20) DEFAULT 'mensual',
completado BOOLEAN DEFAULT FALSE,
notas TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
`);
// Insert demo fiscal events for current year
const año = new Date().getFullYear();
const eventos = [
{ titulo: 'Declaración mensual IVA', tipo: 'declaracion', dia: 17 },
{ titulo: 'Declaración mensual ISR', tipo: 'declaracion', dia: 17 },
{ titulo: 'Pago provisional ISR', tipo: 'pago', dia: 17 },
{ titulo: 'DIOT', tipo: 'obligacion', dia: 17 },
];
for (let mes = 1; mes <= 12; mes++) {
for (const evento of eventos) {
const fechaLimite = new Date(año, mes - 1, evento.dia);
const completado = fechaLimite < new Date();
await prisma.$executeRawUnsafe(`
INSERT INTO "${schemaName}"."calendario_fiscal"
(titulo, descripcion, tipo, fecha_limite, recurrencia, completado)
VALUES ($1, $2, $3, $4, 'mensual', $5)
ON CONFLICT DO NOTHING
`, evento.titulo, `${evento.titulo} - ${mes}/${año}`, evento.tipo, fechaLimite.toISOString(), completado);
}
}
console.log('✅ Calendario fiscal created');
console.log('🎉 Seed completed successfully!');
console.log('\n📝 Demo credentials:');
console.log(' Admin: admin@demo.com / demo123');

View File

@@ -9,6 +9,10 @@ import {
Calculator,
Settings,
LogOut,
BarChart3,
Calendar,
Bell,
Users,
} from 'lucide-react';
import { useAuthStore } from '@/stores/auth-store';
import { logout } from '@/lib/api/auth';
@@ -18,6 +22,10 @@ const navigation = [
{ name: 'Dashboard', href: '/dashboard', icon: LayoutDashboard },
{ name: 'CFDI', href: '/cfdi', icon: FileText },
{ name: 'Impuestos', href: '/impuestos', icon: Calculator },
{ name: 'Reportes', href: '/reportes', icon: BarChart3 },
{ name: 'Calendario', href: '/calendario', icon: Calendar },
{ name: 'Alertas', href: '/alertas', icon: Bell },
{ name: 'Usuarios', href: '/usuarios', icon: Users },
{ name: 'Configuracion', href: '/configuracion', icon: Settings },
];