Commit Graph

69 Commits

Author SHA1 Message Date
196f7a53b3 Fix: Comment out unused ReadingRow interface in bulk-upload service 2026-01-26 19:49:29 -06:00
2d977b13b4 Convert user and role IDs from number to UUID string
Updated backend and frontend to use UUID strings instead of integers for user and role IDs
to match PostgreSQL database schema (UUID type).

Backend changes:
- Updated User and UserPublic interfaces: id and role_id now string (UUID)
- Updated JwtPayload: userId and roleId now string
- Updated user validators: role_id validation changed from number to UUID string
- Removed parseInt() calls in user controller (getUserById, updateUser, deleteUser, changePassword)
- Updated all user service function signatures to accept string IDs
- Updated create() and update() functions to accept role_id as string

Frontend changes:
- Updated User interface in users API: role_id is string
- Updated CreateUserInput and UpdateUserInput: role_id is string
- Added role filter in UsersPage sidebar
- Removed number conversion logic (parseInt)

This fixes the "invalid input syntax for type uuid" error when creating/updating users.
2026-01-26 19:49:15 -06:00
c910ce8996 Fix user schema to match database structure
Updated backend to use single 'name' field instead of 'first_name' and 'last_name'
to match the actual database schema where users table has a 'name' column.

Changes:
- Updated User and UserPublic interfaces to use 'name' and 'avatar_url'
- Updated user validators to use 'name' instead of first/last names
- Updated all SQL queries in user.service.ts to select u.name
- Updated search filters and sort columns
- Fixed user creation and update operations

This resolves the "column u.first_name does not exist" error.
2026-01-26 11:45:30 -06:00
6d25f5103b Add users and roles API integration to UsersPage
Created API modules for users and roles management:
- Added src/api/roles.ts with getAllRoles, getRoleById, createRole, etc.
- Added src/api/users.ts with getAllUsers, createUser, updateUser, etc.

Updated UsersPage to fetch data from backend:
- Fetch roles from /api/roles endpoint on mount
- Fetch users from /api/users endpoint on mount
- Integrated createUser API call with form submission
- Added proper validation and error handling
- Split name field into firstName and lastName for API compatibility
- Added loading states and refresh functionality
2026-01-26 11:45:01 -06:00
Exteban08
6c7d448b2f Fix: Corregir pantalla blanca y mejorar carga masiva
- Fix error .toFixed() con valores DECIMAL de PostgreSQL (string vs number)
- Fix modal de carga masiva que se cerraba sin mostrar resultados
- Validar fechas antes de insertar en BD (evita error con "Installed")
- Agregar mapeos de columnas comunes (device_status, device_name, etc.)
- Normalizar valores de status (Installed -> ACTIVE, New_LoRa -> ACTIVE)
- Actualizar documentación del proyecto

Archivos modificados:
- src/pages/meters/MetersTable.tsx
- src/pages/consumption/ConsumptionPage.tsx
- src/pages/meters/MeterPage.tsx
- water-api/src/services/bulk-upload.service.ts
- ESTADO_ACTUAL.md
- CAMBIOS_SESION.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 23:13:48 +00:00
Exteban08
ab97987c6a Agregar carga masiva de lecturas y corregir manejo de respuestas paginadas
- Implementar carga masiva de lecturas via Excel (backend y frontend)
- Corregir cliente API para manejar respuestas con paginación
- Eliminar referencias a device_id (columna inexistente)
- Cambiar areaName por meterLocation en lecturas
- Actualizar fetchProjects y fetchConcentrators para paginación
- Agregar documentación del estado actual y cambios

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:23:41 +00:00
Exteban08
c81a18987f Migrar backend a PostgreSQL + Node.js/Express con nuevas funcionalidades
Backend (water-api/):
- Crear API REST completa con Express + TypeScript
- Implementar autenticación JWT con refresh tokens
- CRUD completo para: projects, concentrators, meters, gateways, devices, users, roles
- Agregar validación con Zod para todas las entidades
- Implementar webhooks para The Things Stack (LoRaWAN)
- Agregar endpoint de lecturas con filtros y resumen de consumo
- Implementar carga masiva de medidores via Excel (.xlsx)

Frontend:
- Crear cliente HTTP con manejo automático de JWT y refresh
- Actualizar todas las APIs para usar nuevo backend
- Agregar sistema de autenticación real (login, logout, me)
- Agregar selector de tipo (LORA, LoRaWAN, Grandes) en concentradores y medidores
- Agregar campo Meter ID en medidores
- Crear modal de carga masiva para medidores
- Agregar página de consumo con gráficas y filtros
- Corregir carga de proyectos independiente de datos existentes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 10:13:26 +00:00
Exteban08
2b5735d78d Agregar documentacion completa del proyecto
- README.md actualizado con descripcion detallada del sistema
- DOCUMENTATION.md con documentacion tecnica exhaustiva

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:58:02 +00:00
Exteban08
143cd77cee Conflicts 2026-01-14 21:40:17 +00:00
Esteban González
c63e6085bd Merge pull request #9 from luanngel/DevMarlene
Refactor Concentrators & Meters – modularización y tipos de tomas
2026-01-14 15:36:29 -06:00
Marlene-Angel
9af06addad Ajustes UI 2026-01-14 12:34:12 -08:00
Marlene-Angel
16f1f68499 Refactor meters: dividido en hook, sidebar, tabla y modal 2026-01-14 12:32:23 -08:00
Marlene-Angel
3681725b8f Refactor concentrators: dividido en hook, sidebar, tabla y modal 2026-01-14 12:30:08 -08:00
Exteban08
48df8a2bfd Merge branch 'main' of github.com:luanngel/water-project 2026-01-13 04:05:42 +00:00
IvanAS94
f8c75c3c9c Merge pull request #8 from luanngel/DevMarlene
Login GRH, marca de agua tipo membretado y logo en PNG sin fondo
2026-01-12 18:20:34 -08:00
Marlene-Angel
dd3997a3a8 Login GRH, marca de agua tipo membretado y logo en PNG sin fondo 2026-01-12 13:45:25 -08:00
Exteban08
59067b387c Vite config 2026-01-08 19:43:25 +00:00
Exteban08
fab39f099d Add viewId parameter to fetchProjects query 2026-01-08 19:42:54 +00:00
d147b74a54 Meters columns 2026-01-08 13:36:57 -06:00
c3e39819da Change 2026-01-08 13:32:31 -06:00
fc0f682d98 More conflicts 2026-01-08 13:29:56 -06:00
dd65f48a75 New changes conflicts 2026-01-08 13:27:15 -06:00
90c7b3a1c8 vite changes 2026-01-08 13:21:44 -06:00
e136ea8324 Conflicts 2026-01-08 13:21:25 -06:00
1501b29006 Conflicts 2026-01-08 13:16:50 -06:00
Exteban08
64d1f525ad hmr 2026-01-08 04:58:57 +00:00
Exteban08
5da8c12ccd Configure Vite for Cloudflare Tunnel with HMR support 2026-01-08 02:41:42 +00:00
Exteban08
0fc59bb134 Merge remote changes and update local modifications 2026-01-08 02:23:52 +00:00
Exteban08
215b197572 Vite config changes 2026-01-08 02:06:32 +00:00
juancho1127
d7a551011e Merge pull request #5 from luanngel/DevMarlene
Se quitaron los labels de meter
2026-01-07 18:29:36 -06:00
Marlene-Angel
4d807babf7 Se agrega marca de agua GRH y se corrige interacción de perfil en la interfaz 2026-01-07 15:37:57 -08:00
8bb4942caf vite config fix 2026-01-07 00:49:37 -06:00
dce0e33693 Vite config tunnel and Enpoint changes 2026-01-07 00:20:52 -06:00
Marlene-Angel
4ecdd0d656 Merge remote-tracking branch 'origin/DevEsteban' into DevMarlene 2025-12-30 16:50:12 -08:00
juancho1127
53989714c6 Merge pull request #6 from luanngel/DevEsteban
Dev esteban
2025-12-22 18:03:10 -08:00
bbc86bb2d8 Dashboard logic 2025-12-22 15:40:29 -06:00
Marlene-Angel
25da09352d Corrige overflow del layout y autenticación de la API de proyectos 2025-12-22 13:00:53 -08:00
ee35944c44 Dashboard navigate to meters from Tomas card 2025-12-22 01:31:13 -06:00
b9d7eab9db concentrators logic 2025-12-22 01:20:33 -06:00
5a82a717d8 Meters project selection logic fix 2025-12-22 01:16:15 -06:00
820e14463c Meter edit and create logic form & concentrators project select option 2025-12-22 00:19:09 -06:00
a5fa0cfa64 Concentrators create and edit form logic with TTS mock data 2025-12-20 19:45:27 -06:00
014ac19a4b New concentrators fields 2025-12-20 17:15:02 -06:00
Marlene-Angel
1519548c90 Se quitaron los labels de meter 2025-12-20 14:12:49 -08:00
juancho1127
82fa64320b Merge pull request #4 from luanngel/DevMarlene
Ajustes UI en formulario de concentradores
2025-12-20 13:54:27 -08:00
Marlene-Angel
8221f85bb8 Resuelve conflictos al hacer merge con main 2025-12-20 12:28:22 -08:00
Marlene-Angel
9fc1ea3d96 Ajustes UI en formulario de concentradores 2025-12-20 11:59:24 -08:00
juancho1127
67817c8493 Merge pull request #3 from luanngel/DevEsteban
Meters fix to show data in table component
2025-12-20 10:22:41 -08:00
9ece6ff127 Meters fix to show data in table component 2025-12-20 12:21:11 -06:00
juancho1127
f746c845a7 Merge pull request #2 from luanngel/DevEsteban
Dev esteban
2025-12-19 10:00:56 -08:00