# Módulo Convocatorias

# Lista de convocatorias internas (1) - [getInternalCalls]

🧾 **Descripción**

*Obtiene todas las **convocatorias internas vigentes** dentro del ERP, incluyendo información del puesto, sede y su archivo adjunto (PDF u otro documento del Job Opening).*  
El servicio cruza información entre:

- **Job Opening**
- **File** (archivos adjuntos al Job Opening)

Solo trae convocatorias internas **activas (status = "Open")** y marcadas como **convocatoria interna = 1**.

---

# 🚀 Endpoint

**GET /get-internal-calls**

> No recibe parámetros.  
> Toda la información se obtiene mediante apiService() hacia el ERP.

---

# 🔐 Seguridad

Requiere conexión autorizada vía `apiService()`, usando token interno del ERP.

---

# 🧠 Flujo del Servicio (Resumen)

1. **Obtener todos los Job Openings internos activos**
    
    <div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8711%;"></col></colgroup><tbody><tr><td>`<span class="hljs-keyword">GET</span> Job Opening?<span class="hljs-keyword">limit</span>=<span class="hljs-keyword">None</span>    &fields=["name","designation","sucursal"]    &filters=[        ["convocatoria_interna","=",<span class="hljs-number">1</span>],        ["status","=","Open"]    ]`</td></tr></tbody></table>
    
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
    </div></div>
2. **Obtener todos los archivos relacionados al Job Opening**
    
    <div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8711%;"></col></colgroup><tbody><tr><td>`<span class="hljs-keyword">GET</span> File?<span class="hljs-keyword">limit</span>=<span class="hljs-keyword">None</span>    &fields=["name","attached_to_name","file_url"]    &filters=[["attached_to_doctype","=","Job Opening"]]`</td></tr></tbody></table>
    
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
    </div></div>
3. Si alguno de los endpoints devuelve error, se retorna:
    
    <div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8711%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span> <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Error al buscar las convocatorias internas."</span> <span class="hljs-punctuation">}</span>`</td></tr></tbody></table>
    
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
    </div></div>
4. Si no hay convocatorias abiertas:
    
    <div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.8711%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span> <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"En este momento no hay convocatorias internas..."</span> <span class="hljs-punctuation">}</span>`</td></tr></tbody></table>
    
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
    </div></div>
5. Para cada convocatoria se agrega:
    
    
    - La descripción de la sede: `"PARA LA SEDE {sucursal}"`
    - El archivo correspondiente (`file_url`), si existe.
6. Se retorna listado de convocatorias internas enriquecidas.

---

# 📥 Request Body

No tiene body.

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B%7D"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-punctuation">{</span><span class="hljs-punctuation">}</span>`</div></div>---

# 📤 Response 200 – Ejemplo

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Convocatorias internas encontradas"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>    <span class="hljs-punctuation">{</span>      <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"JOB-0001"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"designation"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Analista de Operaciones"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"sucursal"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"LIMA"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"sede"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"PARA LA SEDE LIMA"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"file"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"https://dominio.com/files/job_0001.pdf"</span>    <span class="hljs-punctuation">}</span>  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>---

# ❗ Posibles Errores

### 1. Error en consulta de Job Opening

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Error al buscar las convocatorias internas."</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span><span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>### 2. Error en consulta de archivos File

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-1"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Error al buscar las convocatorias internas."</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span><span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>### 3. No existen convocatorias internas activas

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms-1"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"En este momento no hay convocatorias internas, Estar atento a las proximas convocatorias"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>### 4. Error inesperado del servidor

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-2"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Error del servidor"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"<error completo>"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>---

# 📚 Esquemas (estructuras utilizadas)

### Job Opening

Campos usados:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22name%22%3A-%22string%22%2C-"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"designation"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"sucursal"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>### File

Campos usados:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22name%22%3A-%22string%22%2C--1"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"attached_to_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"file_url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>---

# 🗃 Pseudo-código de la lógica

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-jobs-%3D-get-job-openi"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`jobs = GET Job Opening internas y abiertasif jobs vacío → return no hay convocatoriasfiles = GET File adjuntos a Job Openingfor job in jobs:    job.sede = "PARA LA SEDE " + job.sucursal    job.file = ""    for file in files:        if file.attached_to_name == job.name:            job.file = BASE_CAPACITACION + file.file_urlreturn lista de jobs con su archivo si existe`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr">  
</div></div>

# Obtiene combos (1) - [combosJobApplicant]

🧾 **Descripción**

*Este servicio obtiene y devuelve todos los combos (listas de valores) necesarios para el registro o postulación de un **Job Applicant** (Postulante) dentro del sistema.*

*Los datos se obtienen directamente desde el ERP mediante el método interno `getCombo()`, que consulta tablas maestras como Country, Branch, Department y Gender.*

*Además, incluye una lista estática de tipos de documentos admitidos (DNI, Pasaporte, Carnet de Extranjería)*.

---

# 🚀 Endpoint

**GET /combos-job-applicant**

No requiere parámetros.

---

# 🔐 Seguridad

Requiere autenticación válida en la API del ERP, ya que las consultas internas se realizan mediante: `$<span class="hljs-keyword">this</span>->getCombo(<span class="hljs-string">"<Doctype>"</span>)`

---

# 🧠 Flujo del Servicio (resumen real)

1. Inicializa un arreglo vacío `$combo`.
2. Obtiene desde el ERP las siguientes listas:
    
    
    - Países → Doctype: `Country`
    - Sucursales → Doctype: `Branch`
    - Departamentos → Doctype: `Department`
    - Género → Doctype: `Gender`
3. Agrega una lista fija de tipos de documentos:
    
    <div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-selector-attr">[<span class="hljs-string">"DNI"</span></span>, <span class="hljs-string">"Pasaporte"</span>, <span class="hljs-string">"Carnet de Extranjeria"</span>]`</div></div>
4. Retorna la estructura completa con todos los combos.
5. En caso de error, devuelve una respuesta controlada.

---

# 📥 Request Body

Este servicio **no recibe body**, ni parámetros.

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B%7D"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-punctuation">{</span><span class="hljs-punctuation">}</span>`</div></div>---

# 📤 Response 200 – Ejemplo

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Combos generados correctamente"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>    <span class="hljs-attr">"paises"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>      <span class="hljs-punctuation">{</span> <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Peru"</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>      <span class="hljs-punctuation">{</span> <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Chile"</span> <span class="hljs-punctuation">}</span>    <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"sucursales"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>      <span class="hljs-punctuation">{</span> <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Lima"</span> <span class="hljs-punctuation">}</span>    <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"departamento"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>      <span class="hljs-punctuation">{</span> <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Recursos Humanos"</span> <span class="hljs-punctuation">}</span>    <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"genero"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>      <span class="hljs-punctuation">{</span> <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Masculino"</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>      <span class="hljs-punctuation">{</span> <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Femenino"</span> <span class="hljs-punctuation">}</span>    <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"documentos"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>      <span class="hljs-string">"DNI"</span><span class="hljs-punctuation">,</span>      <span class="hljs-string">"Pasaporte"</span><span class="hljs-punctuation">,</span>      <span class="hljs-string">"Carnet de Extranjeria"</span>    <span class="hljs-punctuation">]</span>  <span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

# ❗ Posibles Errores

### 1. Error de ejecución o conexión con el ERP

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Error del servidor"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> <span class="hljs-attr">"message"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"detalle del error"</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

# 📚 Schemas (estructuras usadas)

### Resultado de getCombo()

El servicio asume que `getCombo()` devuelve una estructura similar a:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%5B-%7B-%22name%22%3A-%22string%22"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">[</span>  <span class="hljs-punctuation">{</span> <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">]</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>### Lista fija de tipos de documentos:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%5B-%22dni%22%2C-%22pasaporte%22"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">[</span>  <span class="hljs-string">"DNI"</span><span class="hljs-punctuation">,</span>  <span class="hljs-string">"Pasaporte"</span><span class="hljs-punctuation">,</span>  <span class="hljs-string">"Carnet de Extranjeria"</span><span class="hljs-punctuation">]</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

# 🗃 Lógica en pseudo-código

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-combo-%3D-%7B%7D-combo%5B%22pa"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`combo = {}combo[<span class="hljs-string">"paises"</span>] = getCombo(<span class="hljs-string">"Country"</span>)combo[<span class="hljs-string">"sucursales"</span>] = getCombo(<span class="hljs-string">"Branch"</span>)combo[<span class="hljs-string">"departamento"</span>] = getCombo(<span class="hljs-string">"Department"</span>)combo[<span class="hljs-string">"genero"</span>] = getCombo(<span class="hljs-string">"Gender"</span>)combo[<span class="hljs-string">"documentos"</span>] = [<span class="hljs-string">"DNI"</span>, <span class="hljs-string">"Pasaporte"</span>, <span class="hljs-string">"Carnet de Extranjeria"</span>]<span class="hljs-keyword">return</span> {   valor: <span class="hljs-literal">true</span>,   msn: <span class="hljs-string">"Combos generados correctamente"</span>,   <span class="hljs-keyword">data</span>: combo}`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>

# Aplicar convocatoria (1) - [setJobApplicantPerApp]

## 🧾 Descripción

Registra una nueva **solicitud de postulación (Job Applicant)** desde la aplicación móvil, validando previamente:

- Que el usuario autenticado no tenga ya una solicitud creada para el mismo puesto.
- Que exista un empleado vinculado al email de sesión.
- Que los campos obligatorios del formulario estén correctamente enviados.
- Que la información personal del empleado se complemente para generar el registro.

Este servicio crea un documento `Job Applicant` en el ERP y también registra un `Error Log` con la data enviada al ERP (para auditoría).

---

## 🚀 Endpoint

**POST /set-job-applicant-per-app**

---

## 📥 Parámetros requeridos (Request Body)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22email_logued%22%3A-%22s"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"email_logued"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (obligatorio)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"job_title"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (obligatorio)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"email_id"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (obligatorio, debe contener @)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"direccion"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"adjuntar_copia_de_documento"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (file url)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"sucursal"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"resume_attachment"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (file url)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"grado_instruccion"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"phone_number"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"country"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"ciudad"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"nacionalidad"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"carrera_profesional"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

## 🔐 Seguridad

- Requiere usuario autenticado en la app.
- La comunicación con el ERP se realiza mediante `apiService()`.
- No requiere token específico del usuario final, es un servicio interno controlado.

---

## 🧠 Flujo del Servicio (Explicación Detallada)

### 1️⃣ Validaciones iniciales

- Verifica que exista `email_logued`.
- Verifica que el email del formulario (`email_id`) sea válido y contenga “@”.
- Valida campos obligatorios: dirección, documentos, sucursal, CV, grado de instrucción, job\_title.

### 2️⃣ Verifica si ya existe una postulación previa

Consulta en el ERP:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-get-job-applicant-%3Fl"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-keyword">GET</span> Job Applicant?<span class="hljs-keyword">limit</span>=<span class="hljs-keyword">None</span>&filters=[["email_logued","=","<email_logued>"], ["job_title","=","<job_title>"]]`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>Si ya existe un registro → **retorna error**.

### 3️⃣ Obtiene datos del empleado

Busca el empleado vinculado al email logueado:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-get-employee-%3Ffields"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`GET Employee?fields=[<span class="hljs-string">"*"</span>]&filters=<span class="hljs-string">[["user_id","=","<email_logued>"]]</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>Si no existe → **retorna error**.

### 4️⃣ Calcula la edad del postulante

Usando la fecha de nacimiento del empleado mediante `DateTime::diff`.

### 5️⃣ Construye el cuerpo del nuevo Job Applicant

Incluye:

- Datos del empleado (nombres, apellidos, género, fecha de nacimiento, DNI, nacionalidad).
- Datos enviados desde la app (CV, copia de documento, email, sucursal, carrera, etc.).
- Estado inicial del proceso: `"status": "Open"`
- Email logueado para relacionarlo a la cuenta APP.

### 6️⃣ Crea el registro Job Applicant

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-post-job-applicant-b"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`POST Job Applicant<span class="hljs-selector-tag">BODY</span>: { ..<span class="hljs-selector-class">.data</span> }`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>### 7️⃣ Registra error interno en Error Log (auditoría)

La respuesta del ERP se envía también a: `<span class="hljs-variable constant_">POST</span> <span class="hljs-title class_">Error</span> <span class="hljs-title class_">Log</span>`

### 8️⃣ Retorna la respuesta al cliente

Si se creó correctamente:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`{  <span class="hljs-string">"valor"</span>: <span class="hljs-literal">true</span>,  <span class="hljs-string">"msn"</span>: <span class="hljs-string">"Solicitud insertada correctamente"</span>,  <span class="hljs-string">"data"</span>: { ... }}`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>Si falló:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`{  <span class="hljs-string">"valor"</span>: <span class="hljs-literal">false</span>,  <span class="hljs-string">"msn"</span>: <span class="hljs-string">"Solicitud no se puede insertar correctamente"</span>,  <span class="hljs-string">"data"</span>: { ... }}`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

## 📤 Respuesta 200 – Ejemplo (Éxito)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms-1"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Solicitud insertada correctamente"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>    <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"JOB-APP-000123"</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"status"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Open"</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"applicant_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Juan Pérez"</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"job_title"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"VAC-2025-005"</span><span class="hljs-punctuation">,</span>    <span class="hljs-attr">"email_logued"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"empleado@empresa.com"</span>  <span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>## ❌ Respuesta 200 – Ejemplo (Error)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-1"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%; height: 29.6px;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr style="height: 29.6px;"><td style="height: 29.6px;">`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Ya existe una solicitud para su usuario"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

## ❗ Posibles Errores Comunes

### 1. Falta email\_logued

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-2"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Es necesario el email con el que ha entrado a la app"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>### 2. Email sin “@”

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-3"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"El email debe contener @"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>### 3. Empleado no existe

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-4"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Error al traer el empleado asociado"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>### 4. Solicitud duplicada

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-5"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Ya existe una solicitud para su usuario"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>### 5. Error al crear Job Applicant

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-6"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%; height: 29.6px;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr style="height: 29.6px;"><td style="height: 29.6px;">`{  <span class="hljs-string">"valor"</span>: <span class="hljs-literal">false</span>,  <span class="hljs-string">"msn"</span>: <span class="hljs-string">"Solicitud no se puede insertar correctamente"</span>,  <span class="hljs-string">"data"</span>: { ...ERP response... }}`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

## 🗃 Estructuras usadas (Schemas)

### ▶ Employee (GET)

Campos consultados:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22first_name%22%3A-%22str"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"first_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"middle_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"first_last_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"second_last_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"nombre_completo"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"gender"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"passport_number"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"date_of_birth"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"date"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"place_of_issue"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>### ▶ Job Applicant (POST)

Campos enviados:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22grado%22%3A-%22string%22%2C"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"grado"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"job_title"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"applicant_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"numero_de_documento"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"email_id"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"sucursal"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"resume_attachment"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"status"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Open"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"email_logued"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

## 🧩 Pseudocódigo del Servicio

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-if-%21email_logued%3A-er"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-keyword">if</span> !email_logued: error<span class="hljs-comment">// validar duplicados</span>list = GET Job Applicant <span class="hljs-keyword">by</span> email_logued & job_title<span class="hljs-keyword">if</span> list > <span class="hljs-number">0</span>: erroremployee = GET Employee <span class="hljs-keyword">by</span> user_id=email_logued<span class="hljs-keyword">if</span> not exists: errorvalidar campos obligatoriosedad = calcular edad(employee.date_of_birth)body = construir Job ApplicantcreateJob = POST Job Applicantregistrar Error Log con createJob<span class="hljs-keyword">if</span> createJob.<span class="hljs-keyword">data</span>:    <span class="hljs-keyword">return</span> success<span class="hljs-keyword">else</span>:    <span class="hljs-keyword">return</span> error`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>