> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Registrar prestador (usuario CAMELLOS + perfil Camello)

> Crea en una transaccion el usuario con rol CAMELLOS y su perfil de camello en estado PENDIENTE. Acepta multipart/form-data cuando se envia foto (campo `file`); en ese caso `trades` y `serviceIds` viajan como cadenas JSON.




## OpenAPI

````yaml /docs/openapi-auth.yaml post /api/register/camello
openapi: 3.0.3
info:
  title: CamellApp API
  version: 1.0.0
  description: |
    Documentacion Swagger de autenticacion, perfil, camellos publicos,
    trabajos (jobs), salud del sistema y administracion (usuarios, servicios,
    categorias, camellos, notificaciones).
    Autenticacion por cookie de sesion NextAuth (`next-auth.session-token`).
servers:
  - url: http://localhost:3000
    description: Local
security: []
tags:
  - name: Auth
    description: Registro y autenticacion (NextAuth)
  - name: Me
    description: Perfil del usuario autenticado
  - name: Camellos
    description: Listado publico de camellos activos y reseñas
  - name: Categories
    description: Categorias publicas
  - name: Search
    description: Interpretacion de busquedas en lenguaje natural (publico)
  - name: Health
    description: Estado del sistema (probe publico y snapshot admin)
  - name: Admin Users
    description: Administracion de usuarios (solo ADMIN)
  - name: Admin Services
    description: Administracion de servicios (solo ADMIN)
  - name: Admin Categories
    description: Administracion de categorias (solo ADMIN)
  - name: Admin Camellos
    description: Administracion de camellos (solo ADMIN)
  - name: Admin Meta
    description: Utilidades admin (OpenAPI)
  - name: Notifications
    description: Inbox y preferencias del usuario autenticado
  - name: Admin Notifications
    description: Centro de envios (solo ADMIN)
  - name: Jobs
    description: Solicitudes de trabajo del usuario autenticado
  - name: Admin Jobs
    description: Asignacion de trabajos (solo ADMIN)
paths:
  /api/register/camello:
    post:
      tags:
        - Auth
      summary: Registrar prestador (usuario CAMELLOS + perfil Camello)
      description: >
        Crea en una transaccion el usuario con rol CAMELLOS y su perfil de
        camello en estado PENDIENTE. Acepta multipart/form-data cuando se envia
        foto (campo `file`); en ese caso `trades` y `serviceIds` viajan como
        cadenas JSON.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CamelloRegisterRequest'
            examples:
              camello:
                value:
                  name: Ana Camello
                  email: ana@demo.com
                  phone: '3109876543'
                  password: ClaveSegura123!
                  confirmPassword: ClaveSegura123!
                  acceptTerms: true
                  documentId: '1102345678'
                  city: Sincelejo
                  neighborhood: Centro
                  professionalCard: null
                  trades:
                    - Plomeria
                    - Gas
                  serviceIds:
                    - plomeria
                  description: Diez anos de experiencia
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                phone:
                  type: string
                password:
                  type: string
                confirmPassword:
                  type: string
                acceptTerms:
                  type: string
                  enum:
                    - 'true'
                documentId:
                  type: string
                city:
                  type: string
                neighborhood:
                  type: string
                professionalCard:
                  type: string
                trades:
                  type: string
                  description: Array JSON de oficios
                  example: '["Plomeria","Gas"]'
                serviceIds:
                  type: string
                  description: Array JSON de ids de servicio
                  example: '["plomeria"]'
                description:
                  type: string
                file:
                  type: string
                  format: binary
      responses:
        '201':
          description: Usuario y camello creados
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CamelloRegisterResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '409':
          description: Email o cedula ya registrados
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    CamelloRegisterRequest:
      type: object
      required:
        - name
        - email
        - phone
        - password
        - confirmPassword
        - acceptTerms
        - city
        - trades
      properties:
        name:
          type: string
          minLength: 2
          maxLength: 120
        email:
          type: string
          format: email
        phone:
          type: string
          minLength: 7
          maxLength: 32
        password:
          type: string
          minLength: 8
          maxLength: 128
        confirmPassword:
          type: string
        acceptTerms:
          type: boolean
          enum:
            - true
        documentId:
          type: string
          maxLength: 32
          nullable: true
        city:
          type: string
          minLength: 2
          maxLength: 120
        neighborhood:
          type: string
          nullable: true
          maxLength: 120
        professionalCard:
          type: string
          nullable: true
          maxLength: 120
        trades:
          type: array
          minItems: 1
          maxItems: 20
          items:
            type: string
        serviceIds:
          type: array
          maxItems: 50
          items:
            type: string
        description:
          type: string
          maxLength: 5000
          nullable: true
    CamelloRegisterResponse:
      type: object
      required:
        - user
        - camello
      properties:
        user:
          type: object
          required:
            - id
            - email
            - role
            - createdAt
          properties:
            id:
              type: string
            name:
              type: string
              nullable: true
            email:
              type: string
              format: email
            role:
              $ref: '#/components/schemas/Role'
            createdAt:
              type: string
              format: date-time
        camello:
          $ref: '#/components/schemas/CamelloDTO'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Sin permisos de administrador
        issues:
          type: object
          nullable: true
        detail:
          type: string
          nullable: true
      required:
        - error
    Role:
      type: string
      enum:
        - ADMIN
        - CAMELLOS
        - CLIENTES
    CamelloDTO:
      type: object
      required:
        - id
        - name
        - trades
        - status
        - premium
        - services
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        name:
          type: string
        documentId:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        trades:
          type: array
          items:
            type: string
        city:
          type: string
          nullable: true
        neighborhood:
          type: string
          nullable: true
        professionalCard:
          type: string
          nullable: true
        photo:
          type: string
          nullable: true
          example: /uploads/camellos/clx....jpg
        status:
          $ref: '#/components/schemas/CamelloStatus'
        premium:
          type: boolean
        notes:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        services:
          type: array
          items:
            $ref: '#/components/schemas/CamelloServiceDTO'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CamelloStatus:
      type: string
      enum:
        - ACTIVO
        - INACTIVO
        - PENDIENTE
    CamelloServiceDTO:
      type: object
      required:
        - id
        - name
        - slug
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
  responses:
    BadRequest:
      description: Datos o parametros invalidos
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Error interno
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````