> For the complete documentation index, see [llms.txt](https://apolo.gitbook.io/gimnasio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apolo.gitbook.io/gimnasio/master.md).

# Socio

## Crear socio

<mark style="color:green;">`POST`</mark> `https://api.cakes.com/socio/crear`

Crear socio

#### Request Body

| Name              | Type   | Description |
| ----------------- | ------ | ----------- |
| foto              | object | archivo.jpg |
| nro\_socio        | string |             |
| id\_descuento     | number |             |
| dni               | number |             |
| domicilio         | string |             |
| celular           | number |             |
| fecha\_nacimiento | string |             |
| apellido          | string |             |
| nombre            | string |             |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "name": "Cake's name",
    "recipe": "Cake's recipe name",
    "cake": "Binary cake"
}
```

{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}

```javascript
{
    "message": "Ain't no cake like that."
}
```

{% endtab %}
{% endtabs %}

## Traer socios

<mark style="color:blue;">`GET`</mark> `/socios/all`

{% tabs %}
{% tab title="200 " %}

```javascript
[
    {
        "id":1,
        "nombre":"Prof. Jon Bode",
        "genero":"masculino",
        "email":"email",
        "nro_socio":"1",
        "apellido":"Abshire",
        "celular":"686.465.8350 x54479",
        "domicilio":"5860 Abner Square\nEast Vilma, MD 94717-4119",
        "fecha_nacimiento":"1981-10-09",
        "dni":63434930,
        "id_descuento":null,
        "created_at":"2019-02-18 23:21:45",
        "updated_at":"2019-02-18 23:21:45",
        "deleted_at":null,
        "ventas":[
            {
                "id":1,
                "fecha":"2019-02-18",
                "vto":"2019-03-20",
                "precio":50,
                "cantidad":1,
                "id_socio":1,
                "id_membresia":1,
                "id_descuento_membresia":3,
                "id_descuento_socio":null,
                "created_at":"2019-02-18 23:21:45",
                "updated_at":"2019-02-18 23:21:45",
                "membresia":
                    {
                        "id":1,
                        "precio":100,
                        "nombre":"membresia 1",
                        "vencimiento_dias":30,
                        "nro_cuotas":1,
                        "created_at":"2019-02-18 23:21:45",
                        "updated_at":"2019-02-18 23:21:45",
                        "deleted_at":null
                    },
                "cuotas":[
                    {
                        "id":1,
                        "pago":50,
                        "nro_cuota":1,
                        "pagada":1,
                        "fecha_inicio":"2019-02-18",
                        "fecha_vto":"2019-03-20",
                        "id_venta":1,
                        "created_at":"2019-02-18 23:21:45",
                        "updated_at":"2019-02-18 23:21:45"
                    }
                ],
                "servicios":[
                    {
                        "id":1,
                        "nombre":"50%",
                        "registra_entrada":1,
                        "creditos_minimos":1,
                        "created_at":"2019-02-18 23:21:45",
                        "updated_at":"2019-02-18 23:21:45",
                        "deleted_at":null,
                        "pivot":{
                            "id_venta":1,
                            "id_servicio":1,
                            "creditos":10,
                            "vto":"2019-03-20",
                            "id":1
                            }
                    }
                ],
                "descuento_membresia":{
                       "id":4,
                        "nombre":"descuento membresia 2",
                        "tipo":1,
                        "porcentaje":50,
                        "vencimiento_dias":30,
                        "aplicable_enconjunto":0,
                        "created_at":"2019-02-18 23:31:35",
                        "updated_at":"2019-02-18 23:31:35",
                        "deleted_at":null
                    },
                "descuento_socio":{
                    "id":2,
                    "nombre":"descuento socio 2",
                    "tipo":2,
                    "porcentaje":50,
                    "vencimiento_dias":30,
                    "aplicable_enconjunto":0,
                    "created_at":"2019-02-18 23:31:35",
                    "updated_at":"2019-02-18 23:31:35",
                    "deleted_at":null
                }
            }
        ]
        ,"descuento":null}]
```

{% endtab %}
{% endtabs %}

## Traer socio

<mark style="color:blue;">`GET`</mark> `/socio/find/:id`

{% tabs %}
{% tab title="200 " %}

```
{
    "id": 1,
    "nombre": "Damian Torphy",
    "genero": "masculino",
    "email": "email",
    "nro_socio": "1",
    "apellido": "Kozey",
    "celular": "259-647-2504 x8606",
    "domicilio": "279 Cristobal Burgs\nHazleborough, MD 21892-4608",
    "fecha_nacimiento": "1993-11-06",
    "dni": 7597435,
    "id_descuento": 13,
    "created_at": "2018-11-25 15:08:58",
    "updated_at": "2018-11-25 15:08:58",
    "deleted_at": null,
    "descuento": {
        "id": 13,
        "nombre": "50%",
        "tipo": 1,
        "porcentaje": 50,
        "vencimiento_dias": 30,
        "aplicable_enconjunto": 0,
        "created_at": "2018-11-25 15:08:58",
        "updated_at": "2018-11-25 15:08:58",
        "deleted_at": null
    }
}
```

{% endtab %}
{% endtabs %}

## Acceder socio

<mark style="color:green;">`POST`</mark> `/socio/acceder`

#### Request Body

| Name       | Type    | Description                                     |
| ---------- | ------- | ----------------------------------------------- |
| idSocio    | number  |                                                 |
| automatico | boolean | <p>Si el ingreso es automatico o manual<br></p> |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Entrada a servicio

<mark style="color:green;">`POST`</mark> `/socio/registrarEntradaAServicio`

#### Request Body

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| idServicio | number |             |
| idSocio    | number |             |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Editar

<mark style="color:orange;">`PUT`</mark> `/socio/editar/:id`

#### Request Body

| Name              | Type   | Description                          |
| ----------------- | ------ | ------------------------------------ |
| foto              | string | si no cambio la foto no poner nadada |
| nro\_socio        | string |                                      |
| id\_descuento     | number |                                      |
| dni               | number |                                      |
| id                | number |                                      |
| nombre            | string |                                      |
| apellido          | string |                                      |
| celular           | number |                                      |
| fecha\_nacimiento | string |                                      |
| domicilio         | string |                                      |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}
