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`.
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.
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.
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.