feat: refactor schedule storage to vanity_hr schema, update onboarding command to /registro, and enhance horario flow with short name collection

This commit is contained in:
Marco Gallegos
2025-12-20 22:43:34 -06:00
parent 338108d7b7
commit d66e8118eb
16 changed files with 570 additions and 405 deletions

View File

@@ -106,6 +106,16 @@ CREATE TABLE IF NOT EXISTS permisos (
FOREIGN KEY (numero_empleado) REFERENCES data_empleadas(numero_empleado)
);
CREATE TABLE IF NOT EXISTS horario_empleadas (
id_horario INT AUTO_INCREMENT PRIMARY KEY,
numero_empleado VARCHAR(15),
telegram_id BIGINT,
dia_semana VARCHAR(20),
hora_entrada_teorica TIME,
hora_salida_teorica TIME,
FOREIGN KEY (numero_empleado) REFERENCES data_empleadas(numero_empleado)
);
USE vanity_attendance;
CREATE TABLE IF NOT EXISTS asistencia_registros (
@@ -120,32 +130,3 @@ CREATE TABLE IF NOT EXISTS asistencia_registros (
telegram_id_usado BIGINT,
FOREIGN KEY (numero_empleado) REFERENCES vanity_hr.data_empleadas(numero_empleado)
);
CREATE TABLE IF NOT EXISTS horario_empleadas (
id_horario INT AUTO_INCREMENT PRIMARY KEY,
numero_empleado VARCHAR(15),
telegram_id BIGINT,
dia_semana VARCHAR(20),
hora_entrada_teorica TIME,
hora_salida_teorica TIME,
FOREIGN KEY (numero_empleado) REFERENCES vanity_hr.data_empleadas(numero_empleado)
);
CREATE TABLE IF NOT EXISTS horarios_configurados (
id INT AUTO_INCREMENT PRIMARY KEY,
telegram_id BIGINT NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
short_name VARCHAR(100),
monday_in TIME,
monday_out TIME,
tuesday_in TIME,
tuesday_out TIME,
wednesday_in TIME,
wednesday_out TIME,
thursday_in TIME,
thursday_out TIME,
friday_in TIME,
friday_out TIME,
saturday_in TIME,
saturday_out TIME
);