Commit Graph

114 Commits

Author SHA1 Message Date
Exteban08
9b8d6c4e45 Add dark/light theme toggle and Conectores section
- Add theme toggle button in TopMenu with Sun/Moon icons
- Save theme preference to localStorage
- Add dark mode CSS configuration with Tailwind @custom-variant
- Apply dark mode classes to Home.tsx, TopMenu, and connector pages
- Add new Conectores section in sidebar with Cable icon
- Create placeholder pages for SH-METERS, XMETERS, and TTS connectors
- Update App.tsx page types and routing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:47:42 +00:00
Exteban08
71623d667f Add complete project documentation
Documentation includes:
- README.md: Project overview and architecture
- API.md: Complete API reference with endpoints
- MANUAL_USUARIO.md: User manual in Spanish
- INSTALACION.md: Installation and deployment guide
- ARQUITECTURA.md: Architecture and database schema
- UPLOAD_PANEL.md: CSV upload panel documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:27:51 +00:00
Exteban08
6118ec2813 Add LORA, LORAWAN, GRANDES CONSUMIDORES meter types
- Set LORA as default meter type
- Add LORAWAN and GRANDES CONSUMIDORES as valid types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:19:01 +00:00
Exteban08
71db4219ca Add CSV upload panel for meters and readings
- Add CSV upload service with upsert logic for meters
- Add CSV upload routes (POST /csv-upload/meters, POST /csv-upload/readings)
- Add template download endpoints for CSV format
- Create standalone upload-panel React app on port 5174
- Support concentrator_serial lookup for meter creation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:08:30 +00:00
7301be7544 Meter fix 2026-02-03 03:02:19 -06:00
ddf98af78a Fix 2026-02-03 02:58:02 -06:00
34e6ef14df Project id fix for meter edit 2026-02-03 02:52:43 -06:00
8e1eefd400 meter route patch method 2026-02-03 02:47:33 -06:00
e99d9c1a7d Relation meter with project 2026-02-03 02:43:55 -06:00
4b977f3eae route patch fix 2026-02-03 02:36:11 -06:00
dda69a59ba Concentrator edit fix 2026-02-03 02:33:21 -06:00
e6df3acad5 middleware fix 2026-02-03 02:26:22 -06:00
0f8f73ea2a Delete project logic 2026-02-03 02:17:14 -06:00
5f51d25bc1 Fix project service 2026-02-03 02:05:10 -06:00
35c44ed13c fix 2026-02-03 01:56:44 -06:00
040f3f97dd Project deleting 2026-02-03 01:53:49 -06:00
5529739749 project service 2026-02-03 01:39:48 -06:00
31ab977f97 Rows per page standarized 2026-02-03 01:26:59 -06:00
d1770b550a Users filter in dashboard as organismos operadores 2026-02-03 01:06:40 -06:00
23c3a19209 Operator project fix 2026-02-03 00:39:08 -06:00
6124bedb8a Operator permissions 2026-02-03 00:28:58 -06:00
5a062ce3a1 Project id for user 2026-02-02 23:55:41 -06:00
9ab1beeef7 Audito dashboard and OPERATOR permissions 2026-02-02 23:23:45 -06:00
b273003366 Meter tyoe logic for projects in concentrators page 2026-02-02 19:01:02 -06:00
f921b20e15 meter type id 2026-02-02 18:00:46 -06:00
6cc4ee0901 meter types 2026-02-02 17:54:01 -06:00
6c5323906d Tipos de toma backend logic 2026-02-02 17:37:10 -06:00
e06941fd02 prueba columns 2026-02-02 01:58:30 -06:00
4f484779d8 Meters columns 2026-02-02 01:43:11 -06:00
46aab5fbba Projects view by user 2026-02-02 01:27:15 -06:00
1d278936b1 add user-project relation and role-based filtering 2026-02-02 01:14:57 -06:00
01aadcf2f3 correct all req.user property references in controllers 2026-02-02 01:03:53 -06:00
d25ec6ebe7 fix: correct req.user property from id to userId in controllers 2026-02-02 00:58:35 -06:00
203e6069c8 Test notifications 2026-02-01 23:40:32 -06:00
1330421ddd auth middleware 2026-02-01 23:02:55 -06:00
0ec9338ac8 auth middleware 2026-02-01 22:56:00 -06:00
58a3efa55c Dev validation deleted 2026-02-01 22:46:21 -06:00
8ca10d0b35 Notifications cronjob 2026-02-01 22:29:48 -06:00
48e0884bf7 Notifications 2026-02-01 20:54:13 -06:00
6c02bd5448 Changes 2026-02-01 18:30:28 -06:00
b5ea12dd27 Meter changes 2026-01-29 18:10:37 -06:00
33b072436d Roles section 2026-01-29 16:41:21 -06:00
13cc4528ff Audit table with better data 2026-01-28 13:28:05 -06:00
936471542a Audit changes 2026-01-27 21:00:39 -06:00
6b9f6810ab audit logic 2026-01-26 20:39:23 -06:00
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