# Novedades

## Crear novedad

**POST** **/api/web/novedades**

### Body:

| Name        | Type   | Desc                    |
| ----------- | ------ | ----------------------- |
| descripcion | string | minLength: 2            |
| prioridad   | string | 'alta', 'media', 'baja' |
| fotoUrl     | string | url                     |
| fecha       | fecha  | ---                     |
| puestosId   | Number | ---                     |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "fecha": "2011-10-01T05:00:00.000Z",
    "fotoUrl": "",
    "fueAtendida": false,
    "id": 1,
    "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
    "prioridad": "media",
    "puestosId": 1,
    "fechaActualizacion": "2011-10-01T05:00:00.000Z",
    "fechaCreacion": "2011-10-01T05:00:00.000Z"
  },
  "codigoEstado": 200
}
```

## Actualizar novedad

**PUT** **/api/web/novedades/:novedadesId**

### Params:

| Name        | Type   | Desc |
| ----------- | ------ | ---- |
| novedadesId | Number | ---  |

### Body:

| Name        | Type   | Desc                    |
| ----------- | ------ | ----------------------- |
| descripcion | string | minLength: 2            |
| prioridad   | string | 'alta', 'media', 'baja' |
| fotoUrl     | string | url                     |
| fecha       | fecha  | ---                     |
| puestosId   | Number | ---                     |

### Request:

```javascript
{
  "descripcion": "aa",
  "prioridad": "media",
  "fecha": "2014-05-21T19:27:28.576Z",
  "fotoUrl": "https://imagen.png",
  "puestosId": 1
}
```

### Response:

```javascript
{
  "estado": true,
  "datos": true,
  "codigoEstado": 200
}
```

## Eliminar novedad

**DELETE** **/api/web/novedades/:novedadesId**

### Params:

| Name        | Type   | Desc |
| ----------- | ------ | ---- |
| novedadesId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": true,
  "codigoEstado": 200
}
```

## Obtener un novedad

**GET** **/api/web/novedades/:novedadesId**

### Params:

| Name        | Type   | Desc |
| ----------- | ------ | ---- |
| novedadesId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "id": 1,
    "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
    "descripcionAtendida": null,
    "prioridad": "media",
    "fecha": "2011-10-01 05:00:00.000 +00:00",
    "fotoUrl": "https://imagen.png",
    "fueAtendida": "0",
    "fechaCreacion": "2011-10-01 05:00:00.000 +00:00",
    "fechaActualizacion": "2011-10-01 05:00:00.000 +00:00",
    "puestosId": 1,
    "inspeccionesId": null
  },
  "codigoEstado": 200
}
```

## Obtener novedades por establecimiento

**GET** **/api/web/novedades/establecimientos/:establecimientosId**

### Params:

| Name               | Type   | Desc |
| ------------------ | ------ | ---- |
| establecimientosId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "novedadesAtendidas": [
      {
        "id": 1,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
        "prioridad": "media",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "1",
        "puestosId": 1,
        "areasId": 1,
        "areasActividad": "gerencia",
        "areasNombre": "Gerente General",
        "areasDescripcionLugar": "Neque incidunt earum quia sint dolorem dolores ut amet.",
        "puestosNombre": "Oficina de gerente general"
      }
    ],
    "novedadesNoAtendidas": [
      {
        "id": 2,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL",
        "prioridad": "baja",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "0",
        "puestosId": 1,
        "areasId": 1,
        "areasActividad": "gerencia",
        "areasNombre": "Gerente General",
        "areasDescripcionLugar": "Neque incidunt earum quia sint dolorem dolores ut amet.",
        "puestosNombre": "Oficina de gerente general"
      }
    ]
  },
  "codigoEstado": 200
}
```

## Obtener novedades por area

**GET** **/api/web/novedades/areas/:areasId**

### Params:

| Name    | Type   | Desc |
| ------- | ------ | ---- |
| areasId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "novedadesAtendidas": [
      {
        "id": 1,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
        "prioridad": "media",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "1",
        "puestosId": 1,
        "puestosNombre": "Oficina de gerente general"
      }
    ],
    "novedadesNoAtendidas": [
      {
        "id": 2,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL",
        "prioridad": "baja",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "0",
        "puestosId": 1,
        "puestosNombre": "Oficina de gerente general"
      }
    ]
  },
  "codigoEstado": 200
}
```

## Obtener novedades por puesto

**GET** **/api/web/novedades/puestos/:puestosId**

### Params:

| Name      | Type   | Desc |
| --------- | ------ | ---- |
| puestosId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "novedadesAtendidas": [
      {
        "id": 1,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
        "prioridad": "media",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "1",
        "puestosId": 1
      }
    ],
    "novedadesNoAtendidas": [
      {
        "id": 2,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL",
        "prioridad": "baja",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "0",
        "puestosId": 1
      }
    ]
  },
  "codigoEstado": 200
}
```
