Client


Representa a un Cliente o comprador de una Company

{warning} Los atributos name, email y phone son protegidos, y sólo los admins pueden ver esos atributos, con excepción de los Providers cuando acceden a un Client a través de una Orden o OrderProvider

Modelo Client

{
    "id": 1,
    "name": "Maria Ortiz Azocar",
    "display_name": "Maria",
    "email": "azocar.ortizmaria@gmail.com",
    "phone": "+04120819113",
    "avatar_url": "http://127.0.0.1:8000/storage/companies/46/avatar/avatar_5_1563301352.jpg",
    "rating_e2": 448,
    "rating_sum": 157,
    "rating_count": 35,
    "created_at": "2019-02-13 15:58:32",
    "updated_at": "2020-03-03 19:45:22",
    "deleted_at": null,
    "account_id": 5,
    "last_name": null,
    "phone_prefix": null,
    "phone_suffix": null,
    "dni": null,
    "uuid": "MJBPM66"
}

Insertar Client

Método URI Cabeceras
POST /companies/{companyId}/clients N/A
{
    "name": "required|max:64|person_name",
    "last_name": "string|max:64|person_name",
    "phone": "string|min:9",
    "password": "string",
    "email": {
        "required": true,
        "email": "rfc,filter",
        "email_initial_char": true,
        "email_domain_check": true
    }
}

Insertar Client de PriceList

Método URI Cabeceras
PUT /companies/{companyId}/price-lists/{priceListId}/clients/{clientId} Authorization

Listar Client

{info} Soporta: Paginación Filters Carga dinámica

Método URI Cabeceras
GET /companies/{companyId}/clients Authorization

Listar Client de Admin

Método URI Cabeceras
GET /companies/{companyId}/admins/{adminId}/clients Authorization

Listar Client de PriceList

{info} Soporta: Paginación Filters Carga dinámica

Método URI Cabeceras
GET /companies/{companyId}/price-lists/{priceListId}/clients Authorization

Listar Setting

Método URI Cabeceras
GET /companies/{companyId}/clients/{clientId}/settings Authorization

Mostrar Client

{info} Soporta: Carga dinámica

Método URI Cabeceras
GET /companies/{companyId}/clients/{clientId} Authorization

Actualizar Client

{info} Soporta: Carga dinámica

Método URI Cabeceras
PATCH /companies/{companyId}/clients/{clientId} Authorization
{
    "name": "max:64|person_name",
    "last_name": "max:64|person_name",
    "phone": "",
    "latitude_e6": "integer",
    "longitude_e6": "integer"
}

Actualizar Setting

Método URI Cabeceras
PATCH /companies/{companyId}/clients/{clientId}/settings Authorization
{
    "dni": "string",
    "born_at": "date",
    "lang": "string",
    "gender": "string|in:male,female,other"
}

Vincular Client

Vincular Client de Admin

Método URI Cabeceras
PUT /companies/{companyId}/admins/{adminId}/clients/{clientId} Authorization

Desvincular Client

Desvincular Client de Admin

Método URI Cabeceras
DELETE /companies/{companyId}/admins/{adminId}/clients/{clientId} Authorization

Sincronizar Client

Sincronizar Client de Admin

Método URI Cabeceras
PUT /companies/{companyId}/admins/{adminId}/clients Authorization
[
    "integer"
]

Eliminar Client

Eliminar Client de PriceList

Método URI Cabeceras
DELETE /companies/{companyId}/price-lists/{priceListId}/clients/{clientId} Authorization

Acciones de Client

Upload Avatar

Método URI Cabeceras
POST /companies/{companyId}/clients/{clientId}/upload-avatar Authorization
{
    "avatar": "required|image|mimes:jpeg,png,bmp|max:2048|dimensions:ratio=1/1"
}

Store By Admin

Método URI Cabeceras
POST /companies/{companyId}/admins/{adminId}/clients Authorization
{
    "name": "required|max:64",
    "phone": "required",
    "email": "email:rfc,filter"
}

Index Allowed

Método URI Cabeceras
GET /companies/{companyId}/clients/{clientId}/allowed-settings Authorization

Enlaces de Client