openapi: 3.0.0
paths:
  /auth/register:
    post:
      operationId: AuthController_register
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegisterDto"
      responses:
        "201":
          description: User successfully registered
        "409":
          description: User already exists
      summary: Register a new user
      tags: &a1
        - auth
  /auth/login:
    post:
      operationId: AuthController_login
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LoginDto"
      responses:
        "200":
          description: User successfully logged in
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthResponseDto"
        "401":
          description: Invalid credentials
      summary: User login
      tags: *a1
  /auth/refresh:
    post:
      operationId: AuthController_refresh
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RefreshTokenDto"
      responses:
        "200":
          description: Token refreshed successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthResponseDto"
        "401":
          description: Invalid refresh token
      summary: Refresh access token
      tags: *a1
  /auth/profile:
    get:
      operationId: AuthController_getProfile
      parameters: []
      responses:
        "200":
          description: User profile retrieved successfully
        "401":
          description: Unauthorized
      security:
        - bearer: []
      summary: Get current user profile
      tags: *a1
info:
  title: Clean House API
  description: The Clean House API description
  version: "1.0"
  contact: {}
tags: []
servers: []
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
  schemas:
    RegisterDto:
      type: object
      properties:
        email:
          type: string
          example: user@example.com
        password:
          type: string
          example: password123
        phoneNumber:
          type: string
          example: "+5511999999999"
        whatsappNumber:
          type: string
          example: "+5511999999999"
      required:
        - email
        - password
    LoginDto:
      type: object
      properties:
        email:
          type: string
          example: user@example.com
        password:
          type: string
          example: password123
      required:
        - email
        - password
    AuthResponseDto:
      type: object
      properties:
        accessToken:
          type: string
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        refreshToken:
          type: string
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        user:
          type: object
      required:
        - accessToken
        - refreshToken
        - user
    RefreshTokenDto:
      type: object
      properties:
        refreshToken:
          type: string
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
      required:
        - refreshToken
