openapi: 3.0.3
info:
  title: TIIX Admin Essentials
  version: 1.0.0
  description: Visao consolidada dos endpoints operacionais mais importantes do admin tecnico.
  license:
    name: Uso interno
    url: https://dash.tiix.com.br/adm/api-docs
servers:
  - url: /adm/api
components:
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: wordpress_logged_in
security:
  - cookieAuth: []
tags:
  - name: Docs
    description: Operacoes da central de documentacao
  - name: Permissions
    description: Sincronizacao e leitura de permissoes
  - name: KPI
    description: Indicadores consolidados do admin
  - name: Cron
    description: Execucao assistida do cron dinamico
paths:
  /Docs/list:
    get:
      tags:
        - Docs
      operationId: Docs.list
      summary: Lista as especificacoes consultaveis da pasta docs/openapi
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Docs/generate:
    post:
      tags:
        - Docs
      operationId: Docs.generate
      summary: Regenera os arquivos base de documentacao
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Docs/bustMaps:
    post:
      tags:
        - Docs
      operationId: Docs.bustMaps
      summary: Reinicia caches auxiliares de mapas e rotas
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Permissions/mySlugs:
    get:
      tags:
        - Permissions
      operationId: Permissions.mySlugs
      summary: Lista os slugs efetivos do usuario atual
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Permissions/scan:
    post:
      tags:
        - Permissions
      operationId: Permissions.scan
      summary: Recebe slugs detectados no front e retorna os que ainda nao existem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                permissoes:
                  type: array
                  items:
                    type: object
                    properties:
                      slug:
                        type: string
                      tipo:
                        type: string
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Permissions/createBatch:
    post:
      tags:
        - Permissions
      operationId: Permissions.createBatch
      summary: Cria permissoes ausentes em lote
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Kpi/overview:
    get:
      tags:
        - KPI
      operationId: Kpi.overview
      summary: Visao geral dos cards do periodo
      parameters:
        - in: query
          name: id_contrato
          schema:
            type: integer
        - in: query
          name: de
          schema:
            type: string
            format: date
        - in: query
          name: ate
          schema:
            type: string
            format: date
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Kpi/agenda:
    get:
      tags:
        - KPI
      operationId: Kpi.agenda
      summary: Indicadores de agenda, utilizacao e SLA
      parameters:
        - in: query
          name: id_contrato
          schema:
            type: integer
        - in: query
          name: de
          schema:
            type: string
            format: date
        - in: query
          name: ate
          schema:
            type: string
            format: date
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Kpi/exportCsv:
    get:
      tags:
        - KPI
      operationId: Kpi.exportCsv
      summary: Exporta os KPIs consolidados em CSV
      parameters:
        - in: query
          name: id_contrato
          schema:
            type: integer
        - in: query
          name: de
          schema:
            type: string
            format: date
        - in: query
          name: ate
          schema:
            type: string
            format: date
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida
  /Cron/run:
    post:
      tags:
        - Cron
      operationId: Cron.run
      summary: Executa tarefas do cron para o escopo informado
      parameters:
        - in: query
          name: scope
          schema:
            type: string
            enum:
              - daily
              - now
        - in: query
          name: id_contrato
          schema:
            type: integer
      responses:
        '200':
          description: OK
        '400':
          description: Requisicao invalida