Commit Graph

35 Commits

Author SHA1 Message Date
Marco Gallegos
9cb9513c41 docs: Actualizar y consolidar la documentación de la base de datos
Se ha actualizado el archivo  para describir con mayor precisión el proceso de registro de usuarios en dos fases, que implica la creación de un registro tanto en la base de datos  como en .

Además, se ha consolidado la documentación de la base de datos eliminando el archivo redundante  y fusionando su contenido en . Esto asegura que  sirva como la única fuente de verdad para la especificación técnica de la base de datos.
2025-12-20 09:27:53 -06:00
Marco Gallegos
1151d3af3d feat: Implement direct MySQL database integration for onboarding and duplicate checks, add Gemini AI support, and update webhook and email configurations. 2025-12-18 15:58:01 -06:00
Marco Gallegos
8387a5851a Merge pull request #5 from marcogll/feat/database-implementation-8116533070439855590
Implement Multi-Database Architecture
2025-12-18 13:38:06 -06:00
google-labs-jules[bot]
4e2b6335a6 feat: Implement multi-database architecture
This commit introduces a three-database architecture to the application,
as specified in the `db_logic.md` file.

The changes include:
- A SQL initialization script (`db/init/init.sql`) to create the
  `USERS_ALMA`, `vanity_hr`, and `vanity_attendance` databases and their
  respective tables.
- SQLAlchemy models for all tables, organized into separate files
  within the `models` directory.
- Refactoring of the database connection logic in `modules/database.py`
  to support connections to all three databases.
- Creation of a `modules/logger.py` to handle request logging to the
  `USERS_ALMA` database.
- Updates to `docker-compose.yml` to mount the initialization script and
  build the bot image locally.
- Updates to `.env.example` to include the new database environment
  variables.
- Restoration of the data dictionary to `db_tasks.md`.
2025-12-18 19:36:40 +00:00
Marco Gallegos
fbb8649748 Create db_logic.md 2025-12-18 13:09:21 -06:00
Marco Gallegos
e14d67cbf6 Merge pull request #4 from marcogll/feat/database-documentation-12411039060362828534
Add Database Schema Documentation
2025-12-16 12:44:19 -06:00
google-labs-jules[bot]
be4057b3ed feat: Enhance database schema for vacation and permission tracking
This commit significantly enhances the database schema defined in `db_tasks.md` to create a robust system for tracking employee vacations and permission requests.

Key changes include:
- **`users` table:** Added `vacation_days_assigned` and `vacation_days_taken` fields to maintain a running balance of employee vacation days.
- **`vacations` table:** Overhauled the table with detailed fields such as `business_days`, `with_pay`, `approver_comments`, `approval_date`, and `affects_payroll` to create a comprehensive vacation tracking system.
- **`permission_requests` table:** Similarly enhanced with fields like `category`, `with_pay`, and `affects_payroll` for detailed tracking of hourly leaves.
- **Interaction Logic:** Updated the documentation to explain how vacation balances are automatically calculated and updated upon the approval of a request.
2025-12-16 17:27:13 +00:00
google-labs-jules[bot]
c35a6cb606 feat: Update database schema documentation
Updates the `db_tasks.md` file to reflect the new database schema and role-based permission system.

This change introduces:
- A new `vacations` table to track vacation requests.
- A new `permission_requests` table for hourly leave requests.
- A redesigned `users` table with more detailed employee information and a `role` column.
- A renamed and expanded `onboarding_data` table.
- An updated database interaction section explaining the `user`, `manager`, and `admin` roles.
2025-12-16 17:08:15 +00:00
google-labs-jules[bot]
7696a0f492 feat: Add database schema documentation
Creates a new `db_tasks.md` file that defines the database schema for the bot.

This documentation includes table definitions for:
- `users`: To store user information.
- `permissions`: To manage user permissions for specific actions.
- `welcome_flow_data`: To store data collected during the `/welcome` onboarding flow.

The file also explains how the bot will interact with these tables to manage users, permissions, and the onboarding process.
2025-12-16 16:47:37 +00:00
Marco Gallegos
3b94c2f90d feat: Add check for existing users and dynamic menu
- Add a check to see if a user's Telegram chat ID already exists in a Google Sheet.
- If the user is already registered, the 'welcome' option is hidden from the main menu.
- Added gspread and google-auth-oauthlib to requirements.txt.
- Modified database.py to support Google Service Account credentials from environment variables.
- Updated .env.example with the new environment variables.
2025-12-15 19:19:37 -06:00
Marco Gallegos
d3035f846e feat: Add GOOGLE_CREDENTIALS_FILE to .env.example for Google API integration 2025-12-15 19:17:56 -06:00
Marco Gallegos
ae8436b01e feat: Integrate Google Sheets for duplicate chat ID verification and update main actions keyboard logic 2025-12-15 19:11:09 -06:00
Marco Gallegos
aad973a9c7 feat: Replace UUID with secure short ID generation for record IDs in webhook payload 2025-12-15 14:17:30 -06:00
Marco Gallegos
9c7d4e3d2e feat: Add version log for version 1.2 and update bot image to 1.2. 2025-12-15 12:32:54 -06:00
Marco Gallegos
d0e13da706 Allow conversation re-entry for flows 2025-12-15 12:30:46 -06:00
Marco Gallegos
68848cee49 feat: Update Dockerfile to use Python 3.12 and modify docker-compose to specify bot image directly; enhance onboarding role selection prompts. 2025-12-15 10:28:32 -06:00
Marco Gallegos
8422a874d9 feat: Implement a new links menu, consolidate the main action keyboard into a ui module, and update employee ID generation logic. 2025-12-15 09:49:50 -06:00
Marco Gallegos
24874da1c7 feat: Add Docker Compose configuration and instructions for Collify deployment, including build optimizations and updated README. 2025-12-14 22:42:04 -06:00
Marco Gallegos
ebbb6c3f00 refactor: Remove printing feature, enhance onboarding derivations, and update bot commands. 2025-12-14 22:32:18 -06:00
Marco Gallegos
29b2605072 feat: Implement detailed onboarding data capture, refactor HR request date processing, and enhance bot command menu. 2025-12-14 22:09:23 -06:00
Marco Gallegos
cbfcee557a feat: Add database health checks and host configuration, enhance the start command with a quick reply keyboard, and improve general text cleaning. 2025-12-14 15:33:47 -06:00
Marco Gallegos
cf128960cb feat: Add print event webhooks and interactive keyboards for HR requests, refactor webhook handling, and remove unused IMAP configuration. 2025-12-14 14:26:13 -06:00
Marco Gallegos
220b78886d feat: Enhance database connection robustness, update onboarding command to /welcome, and remove /socia_finder functionality. 2025-12-14 11:53:45 -06:00
Marco Gallegos
b0d30928f1 Fix: Explicitly pass MySQL credentials to bot service in docker-compose.yml 2025-12-14 11:42:07 -06:00
Marco Gallegos
c0793db73c feat: Implement AI-powered permit reason classification and add comprehensive project documentation. 2025-12-14 11:42:05 -06:00
Marco Gallegos
7a87a010ae Delete .env 2025-12-14 10:14:45 -06:00
Marco Gallegos
a1fab1888a Update .env 2025-12-14 10:14:32 -06:00
Marco Gallegos
7ce9bacce1 feat: Configure environment variables, refactor onboarding conversation states, and expose database port in Docker Compose. 2025-12-14 10:04:34 -06:00
Marco Gallegos
3f3520188c Merge pull request #3 from marcogll/feat/docker-mysql-logging-13516104967243096474
Feat/docker mysql logging 13516104967243096474
2025-12-13 21:50:09 -06:00
Marco Gallegos
7d59333c09 Merge pull request #2 from marcogll/main
Merge pull request #1 from marcogll/feat/docker-mysql-logging-1351610…
2025-12-13 21:46:51 -06:00
google-labs-jules[bot]
93ec6d335c refactor: Implement Docker, MySQL logging, and SMTP email
This commit refactors the application to run in a containerized environment using Docker and Docker Compose. It also introduces a MySQL database for logging user requests and updates the print functionality to send emails via SMTP.

Key changes:
- Added `Dockerfile` and `docker-compose.yml` for containerization.
- Integrated a MySQL database for logging user requests.
- Updated the print module to send files as email attachments via SMTP.
- Added and updated configuration files (`.env`, `.env.example`) to manage secrets and environment variables.
- Removed hardcoded credentials from version control.
- Updated `Readme.md` with new setup and execution instructions.
2025-12-14 03:44:45 +00:00
Marco Gallegos
efb6a2ebec Merge pull request #1 from marcogll/feat/docker-mysql-logging-13516104967243096474
feat: Dockerize application and add MySQL logging
2025-12-13 21:30:41 -06:00
google-labs-jules[bot]
fec578bd7c feat: Dockerize application and add MySQL logging
This commit introduces Docker and Docker Compose to containerize the application and orchestrate it with a MySQL database.

Key changes include:
- Added a `Dockerfile` to create a container for the Python bot.
- Created a `docker-compose.yml` file to manage the bot and MySQL services.
- Added a `modules/database.py` module to handle database connections and logging with SQLAlchemy.
- Integrated request logging into all command handlers.
- Updated `requirements.txt` with necessary dependencies for MySQL.
- Updated `.env` and `.gitignore` to manage database credentials securely.
- Updated `Readme.md` with instructions on how to run the application using Docker Compose.
2025-12-14 03:28:56 +00:00
Marco Gallegos
4653eda462 feat: add .gitignore with common patterns for Python projects, virtual environments, logs, and editor configurations. 2025-12-13 19:06:49 -06:00
Marco Gallegos
1cb382b4ef first commit 2025-12-13 19:06:14 -06:00