Skip to content

feat(database): actualizar ERD para soportar flujo completo de reclutamiento y entrevistas#11

Open
SisleyInTech wants to merge 1 commit intoLIDR-academy:mainfrom
SisleyInTech:db-sjm
Open

feat(database): actualizar ERD para soportar flujo completo de reclutamiento y entrevistas#11
SisleyInTech wants to merge 1 commit intoLIDR-academy:mainfrom
SisleyInTech:db-sjm

Conversation

@SisleyInTech
Copy link

@SisleyInTech SisleyInTech commented Nov 17, 2025

Refactor del modelo de datos para incorporar entidades: Company, Employee, Position, InterviewFlow, InterviewStep, InterviewType, Candidate, Application e Interview. Se aplican principios de normalización, definición de FKs, relaciones y optimizaciones necesarias para posterior implementación con Prisma Migrations.

Actualización del ERD y diseño definitivo del modelo de datos para el flujo de reclutamiento

Resumen

Este PR introduce la actualización completa del Entity Relationship Diagram (ERD) que sirve como base para implementar el flujo de reclutamiento, aplicación y entrevistas dentro del sistema.
El diseño anterior era insuficiente para soportar el ciclo completo; este PR unifica todas las entidades necesarias, normaliza la estructura y prepara el proyecto para la implementación final mediante Prisma.


Cambios principales

1. Nuevo ERD normalizado
2. Normalización aplicada
3. Preparación para Prisma


Impacto

  • Afecta el diseño base del sistema de reclutamiento.
  • No afecta funcionalidades existentes (no hay lógica dependiente aún).
  • Prepara la base para implementar CRUDs, flujos y endpoints relacionados.

Cómo validar

  1. Revisar el ERD incluido.
  2. Confirmar que todas las relaciones del flujo de reclutamiento están representadas.
  3. Validar que todas las entidades poseen sus claves primarias, FKs y tipos adecuados.

Summary by CodeRabbit

  • New Features

    • Enhanced backend infrastructure with comprehensive ATS database schema supporting candidate management, company operations, employee roles, position tracking, job applications, and interview workflows.
  • Documentation

    • Added detailed data model design documentation outlining system architecture, entity relationships, and schema specifications.

@coderabbitai
Copy link

coderabbitai bot commented Nov 17, 2025

Walkthrough

This pull request introduces a comprehensive ATS (Applicant Tracking System) data model redesign. Changes include a complete database schema migration from a simple candidate structure to a full recruitment pipeline system with companies, employees, positions, applications, and interviews. Supporting documentation outlines the data design, relationships, indexing strategy, and implementation guidance.

Changes

Cohort / File(s) Change Summary
Documentation
backend/prisma/DATABASE_DESIGN.md, prompts.md
New markdown files providing detailed ATS data dictionary, entity-relationship diagrams, table definitions, enum specifications, design considerations (normalization, indexing, security), referential integrity rules, and implementation task sequences for schema and migrations
Database Migrations
backend/prisma/migrations/20251117022906_sjm251116/migration.sql
Initial SQL migration creating four core tables: candidates, educations, work_experiences, resumes with primary keys, foreign keys (ON DELETE RESTRICT), unique email index, and normalized structure
Schema Redesign Migration
backend/prisma/migrations/20251117033505_add_complete_interview_flow_system/migration.sql
Major migration replacing legacy candidate tables with full ATS schema: adds five enums (PositionStatus, ApplicationStatus, EmploymentType, InterviewResult, EmployeeRole), creates 12 new tables (companies, employees, interview_types, interview_flows, interview_steps, positions, applications, interviews, plus updated candidates/educations/work_experiences/resumes), establishes 11 foreign key constraints with mixed cascade/restrict rules, and defines 20+ indices for query optimization
Prisma Schema
backend/prisma/schema.prisma
Updated schema adding five new enums, eight new models (Company, Employee, InterviewType, InterviewFlow, InterviewStep, Position, Application, Interview), cascade delete relations on Education/WorkExperience/Resume to Candidate, enhanced Candidate model with timestamps and applications relation, and comprehensive indices with explicit table mappings

Sequence Diagram

sequenceDiagram
    participant Candidate
    participant Position
    participant Application
    participant Interview
    participant InterviewFlow
    participant InterviewStep
    participant Employee

    Note over Candidate,Employee: Old Flow (Pre-Migration)
    Candidate->>Candidate: Store education, resume, work exp

    Note over Candidate,Employee: New ATS Flow (Post-Migration)
    Candidate->>Application: Apply to Position
    activate Application
    Application->>Position: Reference Position
    activate Position
    Position->>InterviewFlow: Use Interview Flow
    activate InterviewFlow
    InterviewFlow->>InterviewStep: Progress through Steps
    activate InterviewStep
    InterviewStep->>Interview: Schedule Interview
    activate Interview
    Interview->>Employee: Assigned Interviewer
    Interview->>Application: Update status
    deactivate Interview
    deactivate InterviewStep
    deactivate InterviewFlow
    deactivate Position
    deactivate Application
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Schema migration complexity: Two sequential migrations with schema drop/recreate; need to verify data migration strategy for existing records
  • Referential integrity: Twelve new tables with mixed ON DELETE CASCADE (candidates→education/resumes/work_experiences, positions→applications, applications→interviews) and ON DELETE RESTRICT (employees→companies, interviews→interviewSteps/employees, applications→candidates) policies require careful validation of business logic
  • Index strategy: Twenty+ indices across multiple tables; composite indices on status, foreign keys, and timestamps need verification for query patterns
  • Enum definitions: Five new enums with default values (e.g., PositionStatus='DRAFT', ApplicationStatus='PENDING') integrated across multiple tables
  • Schema cohesion: Eleven foreign key constraints establish complex relationship graph requiring traceability across all tables

Areas requiring extra attention:

  • ON DELETE RESTRICT constraints on employee/company relationships and their impact on operational workflows
  • Cascade delete implications: candidate deletion cascades to education/resumes/work_experiences but restricts on applications
  • Composite indices effectiveness: interview_steps(interviewFlowId, orderIndex), positions(companyId, status), applications(positionId, status) alignment with anticipated queries
  • Migration safety: Dropping legacy Candidate/Education/Resume/WorkExperience tables in second migration; potential data loss if migration sequence is interrupted
  • Email uniqueness constraints on both candidates and employees; implications for multi-company scenarios

Poem

🐰 Tables now dance in perfect array,
From candidates old to workflows new!
Companies, employees, interviews at play—
Cascades and indices guide the way through.
A schema reborn, clean and refined,
Eight models strong, referential and kind! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the ERD (Entity-Relationship Diagram) to support a complete recruitment and interview flow, which aligns with all the schema additions, new migrations, and documentation changes in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eba3f29 and d1075b2.

📒 Files selected for processing (5)
  • backend/prisma/DATABASE_DESIGN.md (1 hunks)
  • backend/prisma/migrations/20251117022906_sjm251116/migration.sql (1 hunks)
  • backend/prisma/migrations/20251117033505_add_complete_interview_flow_system/migration.sql (1 hunks)
  • backend/prisma/schema.prisma (2 hunks)
  • prompts.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
prompts.md

[grammar] ~1-~1: Corrige la mayúscula.
Context: # Prompts Utilizados Herramienta utilizada: Cursor AI con C...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~132-~132: Corrige la mayúscula.
Context: ...PLEMENTAR EL ERD** #### Análisis del Estado Actual: - Schema existente: Tiene...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~132-~132: Aquí puede haber un error.
Context: ...AR EL ERD** #### Análisis del Estado Actual: - Schema existente: Tiene 4 tablas (`Can...

(QB_NEW_ES)


[grammar] ~133-~133: Agrega una palabra o signo.
Context: ...### Análisis del Estado Actual: - Schema existente: Tiene 4 tablas (`Candidate...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_OTHER)


[grammar] ~133-~133: Cambia la palabra o signo.
Context: ...Education, WorkExperience, Resume) - Requerimiento: Agregar 8 nuevas entida...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~134-~134: Cambia la palabra o signo.
Context: ...ujo completo de posiciones y entrevistas - Enfoque: Mantener las tablas existente...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~135-~135: Aquí puede haber un error.
Context: ...modelo y aplicar normalización e índices --- #### **TAREA 1: Análisis y Planificación del Sc...

(QB_NEW_ES)


[grammar] ~140-~140: Elimina la puntuación
Context: ... de datos óptimos para PostgreSQL/Prisma, e índices necesarios. **Archivos invol...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_PUNCTUATION)


[grammar] ~140-~140: Aquí puede haber un error.
Context: ...PostgreSQL/Prisma, e índices necesarios. Archivos involucrados: Ninguno (anális...

(QB_NEW_ES)


[grammar] ~145-~145: Agrega un signo de puntuación.
Context: ...tablas Position, Application usando enums - Normalizar employment_type en `Posi...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~146-~146: Agrega un signo de puntuación.
Context: ... employment_type en Position usando enum - Agregar índices en FKs y campos de bú...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~147-~147: Agrega un signo de puntuación.
Context: ...(email, status, application_date, interview_date) - Usar tipos apropiados: DateTime par...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~148-~148: Cambia la palabra o signo.
Context: ...ecimalpara salarios,Stringlimitado vsText` - Agregar constraints de unicidad donde ap...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~149-~149: Agrega un signo de puntuación.
Context: ... unicidad donde aplique (ej. email en Employee) - Considerar campos de auditoría (`crea...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~150-~150: Aquí puede haber un error.
Context: ...dAt, updatedAt`) en tablas principales --- #### *TAREA 2: Actualizar el Schema de Prisma...

(QB_NEW_ES)


[grammar] ~166-~166: Cambia la palabra o signo.
Context: ...sma/schema.prisma **Modelos a agregar:** 1.Company- tabla principal de empresas 2.Employ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~167-~167: Cambia la palabra o signo.
Context: ... Company - tabla principal de empresas 2. Employee - empleados vinculados a Company 3. `I...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~168-~168: Cambia la palabra o signo.
Context: ... 2. Employee - empleados vinculados a Company 3. InterviewType - catálogo de tipos de entrevista 4. `In...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~169-~169: Cambia la palabra o signo.
Context: ...wType- catálogo de tipos de entrevista 4.InterviewFlow- flujos de entrevista 5.InterviewStep...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~170-~170: Cambia la palabra o signo.
Context: .... InterviewFlow - flujos de entrevista 5. InterviewStep - pasos dentro de un flujo (con ordenami...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~171-~171: Cambia la palabra o signo.
Context: ...os dentro de un flujo (con ordenamiento) 6. Position - posiciones ofertadas por Company 7. ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~172-~172: Cambia la palabra o signo.
Context: .... Position - posiciones ofertadas por Company 7. Application - aplicaciones de Candidate a `Positio...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~173-~173: Cambia la palabra o signo.
Context: ...cation- aplicaciones deCandidateaPosition8.Interview- entrevistas realizadas dentro de una...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~182-~182: Agrega un signo de puntuación.
Context: ...D, FAILED, NO_SHOW Índices a agregar: - @@index en todas las FKs - @@index en campos d...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~183-~183: Agrega un signo de puntuación.
Context: ... agregar:** - @@index en todas las FKs - @@index en campos de búsqueda frecuente (`status...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~184-~184: Agrega un signo de puntuación.
Context: ...da frecuente (status, fechas, email) - @unique en emails de Employee - @@index comp...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~185-~185: Elimina la palabra o signo.
Context: ...chas, email) - @unique en emails de Employee - @@index compuesto en InterviewStep para (`int...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~190-~190: Corrige la mayúscula.
Context: ...ndex`) --- #### TAREA 3: Generar la Migración de Prisma Descripción: Ejecutar e...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~210-~210: Corrige la mayúscula.
Context: ... Client --- #### TAREA 4: Revisar y Validar el SQL de Migración Descripción: ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~210-~210: Corrige la mayúscula.
Context: ... TAREA 4: Revisar y Validar el SQL de Migración Descripción: Abrir y revisar el a...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~212-~212: Agrega un signo de puntuación.
Context: ... - Las tablas tengan los tipos de datos correctos - Los índices estén presentes - Las FKs...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~213-~213: Agrega un signo de puntuación.
Context: ... de datos correctos - Los índices estén presentes - Las FKs tengan ON DELETE y ON UPDATE ...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~214-~214: Agrega un signo de puntuación.
Context: ... - Las FKs tengan ON DELETE y ON UPDATE apropiados - Los enums estén definidos correctamen...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~215-~215: Agrega un signo de puntuación.
Context: ... apropiados - Los enums estén definidos correctamente - No haya errores de sintaxis **Archiv...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~216-~216: Aquí puede haber un error.
Context: ...rectamente - No haya errores de sintaxis Archivos a revisar: - `backend/prisma/...

(QB_NEW_ES)


[grammar] ~222-~222: Agrega un signo de puntuación.
Context: ...ESTAMP para fechas, VARCHAR con límites apropiados) - Confirmar que índices estén en FKs y ...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~223-~223: Agrega un signo de puntuación.
Context: ...ar que índices estén en FKs y campos de búsqueda - Revisar que las relaciones cascada se...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~224-~224: Aquí puede haber un error.
Context: ...adas (ej. ON DELETE CASCADE vs RESTRICT) --- #### **TAREA 5: Aplicar la Migración a la Base ...

(QB_NEW_ES)


[grammar] ~228-~228: Corrige la mayúscula.
Context: ...TRICT) --- #### TAREA 5: Aplicar la Migración a la Base de Datos Descripción: L...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~228-~228: Corrige la mayúscula.
Context: ...## TAREA 5: Aplicar la Migración a la Base de Datos Descripción: La migració...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~228-~228: Cambia la palabra o signo.
Context: ...EA 5: Aplicar la Migración a la Base de Datos** Descripción: La migración ya se a...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~229-~229: Cambia la palabra o signo.
Context: ...ción a la Base de Datos** Descripción: La migración ya se aplica automáticamen...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~238-~238: Agrega un signo de puntuación.
Context: ...r ver todas las nuevas tablas en Prisma Studio - Verificar la estructura de las tablas...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~239-~239: Agrega un signo de puntuación.
Context: ...Studio - Verificar la estructura de las tablas - Confirmar que las relaciones están co...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~240-~240: Aquí puede haber un error.
Context: ...irmar que las relaciones están correctas --- #### **TAREA 6: Generar el Cliente de Prisma Ac...

(QB_NEW_ES)


[grammar] ~253-~253: Elimina la palabra o signo.
Context: ...isma generate ``` Archivos afectados: - node_modules/.prisma/client/ (generado automáticamente) **Resultado ...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~257-~257: Cambia la palabra o signo.
Context: ...Prisma Client incluye los nuevos modelos - Autocompletado disponible en TypeScript ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~258-~258: Aquí puede haber un error.
Context: ... en TypeScript para las nuevas entidades --- #### **TAREA 7: Documentar las Mejoras Aplicada...

(QB_NEW_ES)


[grammar] ~262-~262: Corrige la mayúscula.
Context: ...es --- #### TAREA 7: Documentar las Mejoras Aplicadas Descripción: Crear un d...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~262-~262: Corrige la mayúscula.
Context: ... #### TAREA 7: Documentar las Mejoras Aplicadas Descripción: Crear un documento q...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~265-~265: Cambia la palabra o signo.
Context: ...y razón de cada uno. Archivo a crear: - backend/prisma/DATABASE_DESIGN.md o agregar sección en README.md **Cont...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~269-~269: Agrega una palabra o signo.
Context: ...E.md` Contenido del documento: - Normalización aplicada: Uso de enums para campos ca...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_OTHER)


[grammar] ~269-~269: Cambia la palabra o signo.
Context: ...:** Uso de enums para campos categóricos - Índices agregados: Lista de índices y ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~270-~270: Cambia la palabra o signo.
Context: ...s:** Lista de índices y su justificación - Tipos de datos: Decisiones sobre VARCH...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~272-~272: Agrega una palabra o signo.
Context: ...RCHAR vs TEXT, uso de DECIMAL, etc. - Relaciones: Explicación de cardinalidades y const...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_OTHER)


[grammar] ~272-~272: Cambia la palabra o signo.
Context: ...licación de cardinalidades y constraints - Campos de auditoría: createdAt y `up...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~273-~273: Aquí puede haber un error.
Context: ...AtyupdatedAt` en modelos principales --- #### **TAREA 8: Crear Datos de Prueba (Seed) - ...

(QB_NEW_ES)


[grammar] ~277-~277: Corrige la mayúscula.
Context: ...principales --- #### TAREA 8: Crear Datos de Prueba (Seed) - OPCIONAL **Descrip...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~277-~277: Corrige la mayúscula.
Context: ...es --- #### TAREA 8: Crear Datos de Prueba (Seed) - OPCIONAL Descripción: Cr...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~277-~277: Corrige la mayúscula.
Context: ... #### TAREA 8: Crear Datos de Prueba (Seed) - OPCIONAL Descripción: Crear un...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)

backend/prisma/DATABASE_DESIGN.md

[grammar] ~1-~1: Aquí puede haber un error.
Context: # 📚 Diccionario de Datos - LTI Talent Tracking System ## 📋 Índ...

(QB_NEW_ES)


[grammar] ~4-~4: Aquí puede haber un error.
Context: ...ng System ## 📋 Índice 1. Descripción General 2. [Diagrama de ...

(QB_NEW_ES)


[grammar] ~5-~5: Aquí puede haber un error.
Context: ...](#descripción-general) 2. [Diagrama de Relación de Entidades](#diagrama-de-relación-de-...

(QB_NEW_ES)


[grammar] ~5-~5: Aquí puede haber un error.
Context: ...ón-general) 2. Diagrama de Relación de Entidades 3....

(QB_NEW_ES)


[grammar] ~7-~7: Aquí puede haber un error.
Context: ...enumeraciones-enums) 4. Diccionario de Tablas 5. [Relaciones...

(QB_NEW_ES)


[grammar] ~8-~8: Aquí puede haber un error.
Context: ...ionario-de-tablas) 5. Relaciones entre Tablas 6. [Índices ...

(QB_NEW_ES)


[grammar] ~9-~9: Aquí puede haber un error.
Context: ...#relaciones-entre-tablas) 6. Índices y Optimizaciones 7. [Reglas ...

(QB_NEW_ES)


[grammar] ~10-~10: Aquí puede haber un error.
Context: ...índices-y-optimizaciones) 7. Reglas de Integridad 8. [Consideraci...

(QB_NEW_ES)


[grammar] ~11-~11: Aquí puede haber un error.
Context: ...s-de-integridad) 8. Consideraciones de Diseño --- ## 📖 Descripción General Este modelo de d...

(QB_NEW_ES)


[grammar] ~15-~15: Aquí puede haber un error.
Context: ...ones-de-diseño) --- ## 📖 Descripción General Este modelo de datos soporta un **Sistem...

(QB_NEW_ES)


[grammar] ~19-~19: Corrige la mayúscula.
Context: ...urada y eficiente. ### Características Principales: - ✅ Gestión de múltiples empresas y sus...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~29-~29: Agrega una palabra o signo.
Context: ...ices estratégicos ### Tecnologías: - ORM: Prisma 5.x - Base de Datos: Postg...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_OTHER)


[grammar] ~29-~29: Aquí puede haber un error.
Context: ...s ### Tecnologías: - ORM: Prisma 5.x - Base de Datos: PostgreSQL - **Lenguaje...

(QB_NEW_ES)


[grammar] ~30-~30: Corrige la mayúscula.
Context: ...gías: - ORM: Prisma 5.x - Base de Datos: PostgreSQL - Lenguaje: TypeScript...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~30-~30: Aquí puede haber un error.
Context: ...ORM:* Prisma 5.x - Base de Datos: PostgreSQL - Lenguaje: TypeScript --- ## 🔄 Diagr...

(QB_NEW_ES)


[grammar] ~200-~200: Cambia la palabra o signo.
Context: ...aciones (ENUMs) ### 1. PositionStatus Estado del ciclo de vida de una posición...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~214-~214: Cambia la palabra o signo.
Context: ...status` --- ### 2. ApplicationStatus Estado de una aplicación de candidato a ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~231-~231: Cambia la palabra o signo.
Context: ...on.status` --- ### 3. EmploymentType Tipo de contratación de la posición. | ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~261-~261: Cambia la palabra o signo.
Context: ...view.result` --- ### 5. EmployeeRole Rol del empleado en el sistema ATS. | V...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~276-~276: Aquí puede haber un error.
Context: ...ployee.role --- ## 📊 Diccionario de Tablas ### **Tabla:companies`** Almacena informació...

(QB_NEW_ES)


[grammar] ~278-~278: Elimina la palabra o signo.
Context: ... 📊 Diccionario de Tablas ### Tabla: companies Almacena información de las empresas que...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~301-~301: Elimina la palabra o signo.
Context: ...ndices:** - PK: id --- ### Tabla: employees Empleados de las empresas que participan...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~330-~330: Elimina la palabra o signo.
Context: ...(ON DELETE RESTRICT) --- ### Tabla: interview_types Catálogo de tipos de entrevista disponib...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~331-~331: Agrega un signo de puntuación.
Context: ...ogo de tipos de entrevista disponibles (ej: Técnica, Cultural, HR). | Campo | Tipo...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~339-~339: Cambia la palabra o signo.
Context: ...ción detallada del tipo | Relaciones: - 1:N con interview_steps (Un tipo se ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~340-~340: Aquí puede haber un error.
Context: ..._steps(Un tipo se usa en muchos pasos) **Índices:** - PK:id- UK:name` **Ej...

(QB_NEW_ES)


[grammar] ~355-~355: Elimina la palabra o signo.
Context: ...ew - Panel Interview --- ### Tabla: interview_flows Define flujos de entrevista reutilizable...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~361-~361: Agrega un signo de puntuación.
Context: ...(255) | No | - | Descripción del flujo (ej: "Standard Tech Flow") | | createdAt |...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~374-~374: Elimina la palabra o signo.
Context: ...ndices:** - PK: id --- ### Tabla: interview_steps Pasos individuales dentro de un flujo de...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~402-~402: Elimina la palabra o signo.
Context: ...(ON DELETE RESTRICT) --- ### Tabla: positions Posiciones laborales abiertas por las em...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~442-~442: Aquí puede haber un error.
Context: ...)- Para filtrar posiciones por empresa **Constraints:** - FK:companyIdcomp...

(QB_NEW_ES)


[grammar] ~450-~450: Elimina la palabra o signo.
Context: ...(ON DELETE RESTRICT) --- ### Tabla: candidates Información básica de candidatos que apl...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~477-~477: Elimina la palabra o signo.
Context: ...a búsquedas rápidas) --- ### Tabla: educations Historial educativo de candidatos. | Ca...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~490-~490: Aquí puede haber un error.
Context: ...s educaciones pertenecen a un candidato) Índices: - PK: id - IDX: `candidateI...

(QB_NEW_ES)


[grammar] ~501-~501: Elimina la palabra o signo.
Context: ... (ON DELETE CASCADE) --- ### Tabla: work_experiences Historial laboral de candidatos. | Camp...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~515-~515: Aquí puede haber un error.
Context: ... experiencias pertenecen a un candidato) Índices: - PK: id - IDX: `candidateI...

(QB_NEW_ES)


[grammar] ~526-~526: Elimina la palabra o signo.
Context: ... (ON DELETE CASCADE) --- ### Tabla: resumes CVs subidos por candidatos. | Campo | T...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~539-~539: Aquí puede haber un error.
Context: ...Múltiples CVs pertenecen a un candidato) Índices: - PK: id - IDX: `candidateI...

(QB_NEW_ES)


[grammar] ~550-~550: Elimina la palabra o signo.
Context: ... (ON DELETE CASCADE) --- ### Tabla: applications Aplicaciones de candidatos a posiciones ...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~586-~586: Elimina la palabra o signo.
Context: ...(ON DELETE RESTRICT) --- ### Tabla: interviews Entrevistas individuales realizadas como...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~626-~626: Aquí puede haber un error.
Context: ... RESTRICT) --- ## 🔗 Relaciones entre Tablas ### Relaciones Principales ``` ┌───────────...

(QB_NEW_ES)


[grammar] ~628-~628: Corrige la mayúscula.
Context: ...Relaciones entre Tablas ### Relaciones Principales ┌─────────────┐ │ COMPANY │ └──────┬──────┘ │ ├──── 1:N ───► EMPLOYEE │ └──── 1:N ───► POSITION ◄──── N:1 ──── INTERVIEW_FLOW │ │ │ │ │ 1:N │ │ ▼ 1:N │ INTERVIEW_STEP ◄──── N:1 ──── INTERVIEW_TYPE │ │ │ 1:N │ ▼ │ APPLICATION ◄──── N:1 ──── CANDIDATE │ │ 1:N │ │ │ 1:N │ │ │ ▼ ▼ INTERVIEW EDUCATION / WORK_EXPERIENCE / RESUME │ └──── N:1 ───► EMPLOYEE ### Cardinalidades Detalladas | Tabla Orige...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~657-~657: Corrige la mayúscula.
Context: ...1 ───► EMPLOYEE ``` ### Cardinalidades Detalladas | Tabla Origen | Relación | Tabla Destin...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~677-~677: Corrige la mayúscula.
Context: ...ples entrevistas | --- ## ⚡ Índices y Optimizaciones ### Índices Simples por Tabla #### `employe...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~679-~679: Corrige la mayúscula.
Context: ...⚡ Índices y Optimizaciones ### Índices Simples por Tabla #### employees ```sql CREA...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~679-~679: Corrige la mayúscula.
Context: ...Optimizaciones ### Índices Simples por Tabla #### employees sql CREATE INDEX idx_employees_companyId ON employees(companyId); CREATE INDEX idx_employees_email ON employees(email); CREATE INDEX idx_employees_isActive ON employees(isActive); CREATE UNIQUE INDEX uk_employees_email ON employees(email); #### positions sql CREATE INDEX idx_positions_companyId ON positions(companyId); CREATE INDEX idx_positions_interviewFlowId ON positions(interviewFlowId); CREATE INDEX idx_positions_status ON positions(status); #### interview_steps sql CREATE INDEX idx_interview_steps_interviewFlowId ON interview_steps(interviewFlowId); CREATE INDEX idx_interview_steps_interviewTypeId ON interview_steps(interviewTypeId); #### applications sql CREATE INDEX idx_applications_positionId ON applications(positionId); CREATE INDEX idx_applications_candidateId ON applications(candidateId); CREATE INDEX idx_applications_status ON applications(status); CREATE INDEX idx_applications_applicationDate ON applications(applicationDate); #### interviews sql CREATE INDEX idx_interviews_applicationId ON interviews(applicationId); CREATE INDEX idx_interviews_interviewStepId ON interviews(interviewStepId); CREATE INDEX idx_interviews_employeeId ON interviews(employeeId); CREATE INDEX idx_interviews_interviewDate ON interviews(interviewDate); CREATE INDEX idx_interviews_result ON interviews(result); ### Índices Compuestos (Optimización Especia...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~719-~719: Corrige la mayúscula.
Context: ...ON interviews(result); ``` ### Índices Compuestos (Optimización Especial) #### Posicione...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~719-~719: Corrige la mayúscula.
Context: ...s(result); ``` ### Índices Compuestos (Optimización Especial) #### Posiciones por Empresa ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~719-~719: Corrige la mayúscula.
Context: ...` ### Índices Compuestos (Optimización Especial) #### Posiciones por Empresa y Estado ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~721-~721: Corrige la mayúscula.
Context: ...mización Especial) #### Posiciones por Empresa y Estado ```sql CREATE INDEX idx_positi...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~721-~721: Corrige la mayúscula.
Context: ...special) #### Posiciones por Empresa y Estado sql CREATE INDEX idx_positions_company_status ON positions(companyId, status); Uso: Recuperar rápidamente todas las p...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~727-~727: Corrige la mayúscula.
Context: ... una empresa específica. #### Pasos de Entrevista Ordenados ```sql CREATE INDEX idx_inter...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~727-~727: Aquí puede haber un error.
Context: ...a específica. #### Pasos de Entrevista Ordenados sql CREATE INDEX idx_interview_steps_flow_order ON interview_steps(interviewFlowId, orderIndex); Uso: Recuperar pasos de un flujo en or...

(QB_NEW_ES)


[grammar] ~733-~733: Corrige la mayúscula.
Context: ... eficientemente. #### Aplicaciones por Posición y Estado ```sql CREATE INDEX idx_applic...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~733-~733: Corrige la mayúscula.
Context: ...ente. #### Aplicaciones por Posición y Estado sql CREATE INDEX idx_applications_position_status ON applications(positionId, status); Uso: Filtrar candidatos en un estado e...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~739-~739: Corrige la mayúscula.
Context: ...ra una posición. #### Aplicaciones por Candidato y Estado ```sql CREATE INDEX idx_applic...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~739-~739: Corrige la mayúscula.
Context: ...ión. #### Aplicaciones por Candidato y Estado sql CREATE INDEX idx_applications_candidate_status ON applications(candidateId, status); Uso: Ver el estado de todas las aplica...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~745-~745: Corrige la mayúscula.
Context: ...ones de un candidato. #### Progreso de Entrevistas sql CREATE INDEX idx_interviews_application_step ON interviews(applicationId, interviewStepId); Uso: Tracking del progreso del candida...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~751-~751: Corrige la mayúscula.
Context: ...el flujo de entrevista. ### Índices de Unicidad | Tabla | Campo(s) | Tipo | Propósito | ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~761-~761: Aquí puede haber un error.
Context: ...sta duplicados | --- ## 🛡️ Reglas de Integridad ### Integridad Referencial (Foreign Keys) #...

(QB_NEW_ES)


[grammar] ~763-~763: Corrige la mayúscula.
Context: ...?️ Reglas de Integridad ### Integridad Referencial (Foreign Keys) #### ON DELETE Policies...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~763-~763: Corrige la mayúscula.
Context: ...Integridad ### Integridad Referencial (Foreign Keys) #### ON DELETE Policies | Relac...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~763-~763: Corrige la mayúscula.
Context: ...ad ### Integridad Referencial (Foreign Keys) #### ON DELETE Policies | Relación |...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~765-~765: Corrige la mayúscula.
Context: ...erencial (Foreign Keys) #### ON DELETE Policies | Relación | Tabla FK | Política | Razón...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~783-~783: Corrige la mayúscula.
Context: ...vistas asignadas | ### Validaciones de Negocio #### Validaciones a Nivel de Aplicación **Po...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~785-~785: Corrige la mayúscula.
Context: ...aciones de Negocio #### Validaciones a Nivel de Aplicación Position: - `salaryM...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~785-~785: Corrige la mayúscula.
Context: ...e Negocio #### Validaciones a Nivel de Aplicación Position: - salaryMinsalaryMax ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~787-~787: Cambia la palabra o signo.
Context: ...iones a Nivel de Aplicación Position: - salaryMinsalaryMax (si ambos están definidos)...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~788-~788: Cambia la palabra o signo.
Context: ...≤ salaryMax (si ambos están definidos) - applicationDeadline debe ser fecha futura - `experienceYears...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~789-~789: Cambia la palabra o signo.
Context: ...plicationDeadlinedebe ser fecha futura -experienceYears≥ 0 **Interview:** -score` debe estar...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~792-~792: Cambia la palabra o signo.
Context: ...ra - experienceYears ≥ 0 Interview: - score debe estar entre 0 y 100 (si está defini...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~793-~793: Cambia la palabra o signo.
Context: ...e estar entre 0 y 100 (si está definido) - interviewDateapplication.applicationDate - `actua...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~794-~794: Elimina la palabra o signo.
Context: ... (si está definido) - interviewDateapplication.applicationDate - actualEndTimeinterviewDate (si está definido) *...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~797-~797: Cambia la palabra o signo.
Context: ...te(si está definido) **InterviewStep:** -orderIndex` ≥ 0 - No debe haber dos pasos con el mis...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~798-~798: Cambia la palabra o signo.
Context: ...) InterviewStep: - orderIndex ≥ 0 - No debe haber dos pasos con el mismo `or...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~802-~802: Cambia la palabra o signo.
Context: ...das (mismo candidateId + positionId) - applicationDateposition.applicationDeadline (si est...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~803-~803: Aquí puede haber un error.
Context: ....applicationDeadline` (si está definido) ### Campos Obligatorios vs Opcionales #### ...

(QB_NEW_ES)


[grammar] ~805-~805: Corrige la mayúscula.
Context: ...eadline` (si está definido) ### Campos Obligatorios vs Opcionales #### Campos Obligatorios...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~805-~805: Aquí puede haber un error.
Context: ...está definido) ### Campos Obligatorios vs Opcionales #### Campos Obligatorios (N...

(QB_NEW_ES)


[grammar] ~805-~805: Aquí puede haber un error.
Context: ...á definido) ### Campos Obligatorios vs Opcionales #### Campos Obligatorios (NOT NULL) - IDs pri...

(QB_NEW_ES)


[grammar] ~807-~807: Corrige la mayúscula.
Context: ...Obligatorios vs Opcionales #### Campos Obligatorios (NOT NULL) - IDs primarios y foráneos -...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~807-~807: Cambia la palabra o signo.
Context: ...cionales #### Campos Obligatorios (NOT NULL) - IDs primarios y foráneos - Campos de ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_PUNCTUATION)


[grammar] ~812-~812: Corrige la mayúscula.
Context: ...(status, isActive, counts) #### Campos Opcionales (NULL) - Información complementaria (te...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~821-~821: Aquí puede haber un error.
Context: ...nReason) --- ## 🎨 Consideraciones de Diseño ### 1. Normalización Aplicada #### Terc...

(QB_NEW_ES)


[grammar] ~823-~823: Corrige la mayúscula.
Context: ...iones de Diseño ### 1. Normalización Aplicada #### Tercera Forma Normal (3NF) Todas las tab...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~831-~831: Corrige la mayúscula.
Context: ...cias transitivas #### Desnormalización Estratégica Se aplicó desnormalización controlada e...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~832-~832: Oración con errores
Context: ...ización controlada en casos específicos: - Position.viewCount y Position.applicationCount: Contadores...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)


[grammar] ~834-~834: Aquí puede haber un error.
Context: ... rápidas - Application.statusChangedAt: Timestamp de último cambio de estado pa...

(QB_NEW_ES)


[grammar] ~836-~836: Corrige la mayúscula.
Context: ...ara auditoría ### 2. Optimización de Tipos de Datos #### Tipos Numéricos - `INT...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~836-~836: Corrige la mayúscula.
Context: ...oría ### 2. Optimización de Tipos de Datos #### Tipos Numéricos - INTEGER para IDs y c...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~838-~838: Oración con errores
Context: ...ización de Tipos de Datos** #### Tipos Numéricos - INTEGER para IDs y contadores - DECIMAL(12,2) ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)


[grammar] ~839-~839: Agrega un signo de puntuación.
Context: ...éricos - INTEGER para IDs y contadores - DECIMAL(12,2) para salarios (precisión monetaria) - `B...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~840-~840: Agrega un signo de puntuación.
Context: ...,2)para salarios (precisión monetaria) -BIGINT` para tamaños de archivo (soporta archivo...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~843-~843: Oración con errores
Context: ...oporta archivos grandes) #### Tipos de Texto - VARCHAR(n) para campos con límite conocido (optimiza es...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)


[grammar] ~844-~844: Cambia la palabra o signo.
Context: ...s con límite conocido (optimiza espacio) - TEXT para contenido sin límite predecible (descri...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~845-~845: Aquí puede haber un error.
Context: ...límite predecible (descripciones, notas) #### Tipos Temporales - TIMESTAMP para toda...

(QB_NEW_ES)


[grammar] ~847-~847: Oración con errores
Context: ...ible (descripciones, notas) #### Tipos Temporales - TIMESTAMP para todas las fechas (incluye hora, zon...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)


[grammar] ~848-~848: Agrega un signo de puntuación.
Context: ... las fechas (incluye hora, zona horaria) - DateTime en Prisma se mapea a `TIMESTAMP WITH TIM...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~851-~851: Corrige la mayúscula.
Context: ...` en PostgreSQL ### 3. Estrategia de Índices #### Índices en Claves Foráneas Todos los cam...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~853-~853: Corrige la mayúscula.
Context: ...strategia de Índices** #### Índices en Claves Foráneas Todos los campos FK tienen índ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~853-~853: Corrige la mayúscula.
Context: ...ia de Índices** #### Índices en Claves Foráneas Todos los campos FK tienen índices para...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~857-~857: Cambia la palabra o signo.
Context: ...sados en cláusulas WHERE tienen índices: - status (filtrado frecuente) - isActive (filtr...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~858-~858: Cambia la palabra o signo.
Context: ...índices: - status (filtrado frecuente) - isActive (filtrado de empleados activos) - `email...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~859-~859: Cambia la palabra o signo.
Context: ...sActive(filtrado de empleados activos) -email` (búsquedas de usuarios) #### Índices en...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~862-~862: Cambia la palabra o signo.
Context: ...de usuarios) #### Índices en Campos de Ordenamiento - applicationDate (ordenar por fecha) - interviewDate (o...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~863-~863: Cambia la palabra o signo.
Context: ... - applicationDate (ordenar por fecha) - interviewDate (ordenar cronológicamente) - `orderIndex...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~864-~864: Cambia la palabra o signo.
Context: ...nterviewDate(ordenar cronológicamente) -orderIndex` (orden de pasos de entrevista) #### Índ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~867-~867: Corrige la mayúscula.
Context: ...n de pasos de entrevista) #### Índices Compuestos Para queries complejas que filtran por ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~868-~868: Cambia la palabra o signo.
Context: ...ejas que filtran por múltiples columnas: - (companyId, status) - Posiciones abiertas por empresa - `(in...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~869-~869: Cambia la palabra o signo.
Context: ...atus)- Posiciones abiertas por empresa -(interviewFlowId, orderIndex)` - Pasos ordenados de un flujo ### 4. **...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_SPACE)


[grammar] ~874-~874: Cambia la palabra o signo.
Context: ...Timestamps** #### Tablas con Auditoría Completa - companies, employees, positions, `applications...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~875-~875: Cambia la palabra o signo.
Context: ...employees, positions, applications, interviews - interview_flows #### Campos de Auditoría - createdAt: Regis...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_PUNCTUATION)


[grammar] ~878-~878: Cambia la palabra o signo.
Context: ...ws-interview_flows #### Campos de Auditoría -createdAt`: Registro de creación aut...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~885-~885: Corrige la mayúscula.
Context: ... Escalabilidad #### Preparado para Crecimiento - Índices estratégicos para queries de ...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~890-~890: Cambia la palabra o signo.
Context: ...grandes volúmenes #### Consideraciones Futuras - Particionamiento de tabla `applicatio...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~895-~895: Corrige la mayúscula.
Context: ...os (soft deletes) ### 6. Seguridad y Privacidad #### Datos Sensibles - Información personal d...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~897-~897: Cambia la palabra o signo.
Context: ... Seguridad y Privacidad #### Datos Sensibles - Información personal de candidatos (e...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[grammar] ~902-~902: Cambia la palabra o signo.
Context: ...de entrevistas #### Recomendaciones de Implementación - Encriptar campos sensibles a nivel de...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)


[style] ~903-~903: En sentido figurado es preferible usar otras expresiones.
Context: ...ementación - Encriptar campos sensibles a nivel de aplicación - Implementar RBAC basado en...

(A_NIVEL_DE)


[grammar] ~903-~903: Agrega un signo de puntuación.
Context: ...- Encriptar campos sensibles a nivel de aplicación - Implementar RBAC basado en `Employee....

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~904-~904: Agrega un signo de puntuación.
Context: ... aplicación - Implementar RBAC basado en Employee.role - Auditar accesos a datos de candidatos - ...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~905-~905: Agrega un signo de puntuación.
Context: ...oyee.role` - Auditar accesos a datos de candidatos - Implementar políticas de retención de...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~906-~906: Aquí puede haber un error.
Context: ...lementar políticas de retención de datos ### 7. Flexibilidad del Diseño #### Con...

(QB_NEW_ES)


[grammar] ~908-~908: Corrige la mayúscula.
Context: ...ión de datos ### 7. Flexibilidad del Diseño #### Configuración Reutilizable - `InterviewF...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~910-~910: Oración con errores
Context: ...ilidad del Diseño** #### Configuración Reutilizable - InterviewFlow permite crear flujos reutilizables - `In...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)


[grammar] ~911-~911: Elimina la palabra o signo.
Context: ...Flowpermite crear flujos reutilizables -InterviewTypecomo catálogo compartido -EmployeeRole...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~912-~912: Elimina la palabra o signo.
Context: ...InterviewType como catálogo compartido - EmployeeRole para control de acceso flexible #### Ex...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~913-~913: Aquí puede haber un error.
Context: ...yeeRole` para control de acceso flexible #### Extensibilidad El diseño permite agregar...

(QB_NEW_ES)


[grammar] ~924-~924: Aquí puede haber un error.
Context: ...(columnas opcionales) --- ## 📝 Notas Adicionales ### Convenciones de Nomenclatura #### Tabla...

(QB_NEW_ES)


[grammar] ~926-~926: Corrige la mayúscula.
Context: ... Notas Adicionales ### Convenciones de Nomenclatura #### Tablas - Nombres en plural (snake_case e...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)


[grammar] ~932-~932: Agrega un signo de puntuación.
Context: ...) - Mapeo explícito con @@map() #### Campos - camelCase en Prisma - snake_case en P...

(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)


[grammar] ~944-~944: Elimina la palabra o signo.
Context: ...isma Client - Generación automática con prisma generate - TypeScript type-safe - Autocompletado co...

(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_SPACE)


[grammar] ~955-~955: Aquí puede haber un error.
Context: ...iones especiales --- ## 🚀 Siguientes Pasos ### Implementación 1. ✅ Schema Prisma defini...

(QB_NEW_ES)


[grammar] ~987-~987: Corrige la mayúscula.
Context: ...ml) --- Versión: 1.0.0 Última Actualización: Noviembre 2025 Autor: AI4Devs D...

(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_UPPERCASE)

🪛 markdownlint-cli2 (0.18.1)
prompts.md

7-7: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)


9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


304-304: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


326-326: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


334-334: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


342-342: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


350-350: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


358-358: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

backend/prisma/DATABASE_DESIGN.md

4-4: Link fragments should be valid

(MD051, link-fragments)


5-5: Link fragments should be valid

(MD051, link-fragments)


6-6: Link fragments should be valid

(MD051, link-fragments)


7-7: Link fragments should be valid

(MD051, link-fragments)


8-8: Link fragments should be valid

(MD051, link-fragments)


9-9: Link fragments should be valid

(MD051, link-fragments)


10-10: Link fragments should be valid

(MD051, link-fragments)


11-11: Link fragments should be valid

(MD051, link-fragments)


630-630: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (8)
backend/prisma/schema.prisma (7)

21-60: Enums are well-structured and comprehensive.

The five enums capture all necessary categorical values for the ATS domain. PositionStatus, ApplicationStatus, EmploymentType, InterviewResult, and EmployeeRole cover the full recruitment lifecycle with appropriate state transitions.


66-122: Candidate and related models have appropriate cascade delete strategy.

Lines 75–78 establish one-to-many relationships with Education, WorkExperience, Resume, and Application. The cascade delete on education/work experience/resume (line 91, 105, 118) is appropriate since these are dependent records without independent value. However, verify line 253: Candidate uses onDelete: Restrict for Application, which prevents candidate deletion if applications exist—this is intentional and correct for data preservation.


143-159: Employee–Company relationship uses correct restrictive delete policy.

Line 152 specifies onDelete: Restrict for the company FK, preventing company deletion while employees exist. This protects referential integrity. However, verify that your application layer handles the case where an employee is deactivated (via isActive field on line 149) vs. deleted, as restricting deletion may require additional business logic.

Confirm that employee deactivation (soft delete via isActive flag) is the primary path for removing active employees from recruitment workflows, rather than hard deletion.


185-199: Composite indices on InterviewStep optimize ordered workflow queries.

Lines 195–197 define three indices: on interviewFlowId, interviewTypeId, and a composite (interviewFlowId, orderIndex). The composite index is particularly well-chosen because querying steps in sequence (e.g., "get all steps for flow X in order") is a common operation. This avoids redundant full-table scans.


205-239: Position model is comprehensive but review FK cascading and defaults.

The Position model correctly references Company and InterviewFlow with onDelete: Restrict (lines 230–231), preventing orphaned positions. Audit timestamps are present (lines 228–229). However, note:

  • Line 211: status defaults to DRAFT, which is appropriate—new positions start unpublished.
  • Line 217–218: Salary fields use Decimal(12, 2), ideal for monetary precision.
  • Line 224–225: Counter fields (viewCount, applicationCount) default to 0, enabling metrics without nullable fields.

Verify that application code increments these counters transactionally to avoid race conditions.

Ensure that counter increments (e.g., applicationCount) are implemented as atomic database operations (e.g., UPDATE positions SET applicationCount = applicationCount + 1) rather than read-modify-write cycles in application code.


241-263: Application model references are well-constrained; verify statusChangedAt initialization.

Lines 252–253 reference Position and Candidate with appropriate cascade/restrict policies:

  • positionId cascades on deletion (position removal cascades to applications—correct).
  • candidateId restricts deletion (candidate removal does not cascade—correct for data preservation).

However, note line 248: statusChangedAt uses @updatedAt, which auto-updates on record modification. This is correct for tracking status changes, but verify that your application explicitly updates status whenever status changes (rather than allowing implicit updates), to maintain data integrity.

Confirm that application code updates the status field explicitly and does not rely on side effects to trigger statusChangedAt updates.


269-294: Interview model has appropriate cascading and composite index for tracking.

Lines 283–285 use cascade for applicationId (deleting an application deletes its interviews—correct) and restrict for interviewStepId and employeeId (protecting interview configurations and employee records). Line 292 defines a composite index on (applicationId, interviewStepId), which optimizes queries tracking a candidate's progress through interview steps for a specific application.

prompts.md (1)

1-123: Documentation artifact is well-organized and accurate.

The prompts.md file effectively captures the iterative process used to build the database schema. The task breakdown (TAREA 1–8) is clear and sequential, with explicit dependencies outlined at the end (lines 302–320). The prompts accurately reflect the ERD requirements and normalization goals.

Minor note: Static analysis tools flag numerous Spanish grammar/punctuation issues (e.g., capitalization in section headings). These are documentation quality concerns but do not affect functionality. If stricter documentation standards are enforced, consider a grammar pass, but these are not blockers for code review.

Comment on lines +1 to +59
-- CreateTable
CREATE TABLE "Candidate" (
"id" SERIAL NOT NULL,
"firstName" VARCHAR(100) NOT NULL,
"lastName" VARCHAR(100) NOT NULL,
"email" VARCHAR(255) NOT NULL,
"phone" VARCHAR(15),
"address" VARCHAR(100),

CONSTRAINT "Candidate_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Education" (
"id" SERIAL NOT NULL,
"institution" VARCHAR(100) NOT NULL,
"title" VARCHAR(250) NOT NULL,
"startDate" TIMESTAMP(3) NOT NULL,
"endDate" TIMESTAMP(3),
"candidateId" INTEGER NOT NULL,

CONSTRAINT "Education_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "WorkExperience" (
"id" SERIAL NOT NULL,
"company" VARCHAR(100) NOT NULL,
"position" VARCHAR(100) NOT NULL,
"description" VARCHAR(200),
"startDate" TIMESTAMP(3) NOT NULL,
"endDate" TIMESTAMP(3),
"candidateId" INTEGER NOT NULL,

CONSTRAINT "WorkExperience_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Resume" (
"id" SERIAL NOT NULL,
"filePath" VARCHAR(500) NOT NULL,
"fileType" VARCHAR(50) NOT NULL,
"uploadDate" TIMESTAMP(3) NOT NULL,
"candidateId" INTEGER NOT NULL,

CONSTRAINT "Resume_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "Candidate_email_key" ON "Candidate"("email");

-- AddForeignKey
ALTER TABLE "Education" ADD CONSTRAINT "Education_candidateId_fkey" FOREIGN KEY ("candidateId") REFERENCES "Candidate"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "WorkExperience" ADD CONSTRAINT "WorkExperience_candidateId_fkey" FOREIGN KEY ("candidateId") REFERENCES "Candidate"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Resume" ADD CONSTRAINT "Resume_candidateId_fkey" FOREIGN KEY ("candidateId") REFERENCES "Candidate"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Migration structure is correct but will be superseded by later migration.

This migration creates four tables (Candidate, Education, WorkExperience, Resume) with proper primary keys, foreign keys (ON DELETE RESTRICT), and a unique email index on Candidate. The schema is normalized and follows PostgreSQL conventions.

However, note that the later migration 20251117033505_add_complete_interview_flow_system drops and recreates these exact tables (lines 34–44 in that migration), with a different cascade strategy (ON DELETE CASCADE instead of RESTRICT for child tables). This creates a backward-compatibility concern: if any data exists when the second migration runs, it will be lost.

Data loss risk: The second migration drops all four tables created here. If production data exists, this migration is destructive. Verify:

  1. This PR is intended for a greenfield deployment (no existing data).
  2. If existing data exists, provide a data migration path or squash these migrations.
  3. Consider adding explicit rollback instructions in migration comments.

Recommend either:

  • Squashing both migrations into a single migration that creates the final schema directly.
  • Or explicitly documenting that this sequence requires a fresh database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant