feat: services, jwt auth, and api controllers

- LeadService with 15 SP calls (CRUD, actividades, pagos, montos)
- UsuarioService for login and profile queries
- JwtService for token generation with claims
- AuthController (login, perfil) with HttpOnly cookie
- LeadController (CRUD, actividades, estado, pago, contacto)
- Registered all services in DI (Program.cs)
This commit is contained in:
2026-07-07 17:56:25 -04:00
parent 3d5419403d
commit aed251d82f
7 changed files with 445 additions and 15 deletions
+18 -15
View File
@@ -14,9 +14,9 @@
| Backend .NET 10 — Skeleton (sln + 4 proyectos + NuGet) | ✅ CREADO |
| Entidades / DTOs / Interfaces (Ventas.Core) | ✅ CREADO |
| Infrastructure (EF Core + Dapper + Repos) | ✅ PARCIAL (DbContext + LeadRepository listos) |
| Services (lógica de negocio) | PENDIENTE |
| API Controllers | PENDIENTE |
| Auth JWT | ❌ PENDIENTE |
| Services (lógica de negocio) | PARCIAL (LeadService, UsuarioService, JwtService) |
| API Controllers | PARCIAL (AuthController, LeadController) |
| Auth JWT | ✅ CREADO (JwtService + middleware) |
| Reportes QuestPDF (17 reportes) | ❌ PENDIENTE |
| ServicesExternos.API | ❌ PENDIENTE |
| Frontend Next.js | ❌ PENDIENTE |
@@ -42,17 +42,19 @@
- [ ] Configurations/ (EF mapping)
- [ ] Resto repos (Alumno, Contrato, Cotizacion, etc.)
- [ ] SpComplexQueries.cs (Dapper multi-resultset)
- [ ] **1.4 Ventas.Services — Lógica de Negocio** (~2 sem)
- [ ] LeadService.cs + resto servicios (~15)
- [ ] **1.5 Ventas.API — Controladores REST** (~1 sem)
- [ ] AuthController.cs
- [ ] LeadController.cs + resto controllers (~20)
- [ ] Program.cs completo (DI, JWT, CORS)
- [ ] appsettings.json con connection strings
- [ ] **1.6 Auth JWT** (~3 días)
- [ ] JwtMiddleware.cs
- [ ] Login endpoint funcional
- [ ] Claims → cookies HttpOnly
- [x] **1.4 Ventas.Services — Lógica de Negocio** (~2 sem)
- [x] LeadService.cs, UsuarioService.cs, JwtService.cs
- [ ] Resto servicios (Contrato, Cotizacion, Alumno, etc.)
- [x] **1.5 Ventas.API — Controladores REST** (~1 sem)
- [x] AuthController.cs (login + perfil)
- [x] LeadController.cs (CRUD + actividades + pagos)
- [x] Program.cs completo (DI, JWT, CORS)
- [x] appsettings.json con connection strings
- [ ] Resto controllers (Contrato, Cotizacion, Alumno, etc.)
- [x] **1.6 Auth JWT** (~3 días)
- [x] JwtService.cs (generación de tokens)
- [x] Login endpoint funcional
- [x] Claims → cookies HttpOnly
- [ ] **1.7 Reportes QuestPDF** (~2-3 sem)
- [ ] ReportService.cs (base)
- [ ] 17 reportes (Contrato, Cotización, Arqueo, etc.)
@@ -103,7 +105,8 @@
| Fecha | Fase | Qué se hizo | Siguiente paso |
|-------|------|-------------|----------------|
| 2026-07-07 | F1 | Entities (25), Enums (4), DTOs, Interfaces (6), DbContext, LeadRepository, LeadQueryRepository, DI setup, appsettings | Resto repos (Contrato, Cotizacion, Alumno) + Controllers |
| 2026-07-07 | F1 | Entities (25), Enums, DTOs, Interfaces, DbContext, LeadRepository + LeadQueryRepository, DI, JWT, appsettings | Resto repos + Controllers |
| 2026-07-07 | F1 | LeadService, UsuarioService, JwtService, AuthController, LeadController | Resto Services + Controllers |
| | | | |
| | | | |