openapi: 3.0.3
info:
  title: Contrato Site Menus Admin
  version: v1.0.0
servers:
  - url: /adm/api
tags:
  - name: ContratoSiteMenusAdmin
paths:
  /ContratoSiteMenusAdmin/save_item:
    post:
      tags: [ContratoSiteMenusAdmin]
      summary: Cria/edita item de menu
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contrato: { type: integer, example: 57 }
                id: { type: integer, example: 0 }
                label: { type: string, maxLength: 200, example: "Planos" }
                link:  { type: string, maxLength: 100, example: "pagina-123" }
                target:
                  type: string
                  enum: [_self, _blank]
                  maxLength: 25
                icon:  { type: string, maxLength: 50, example: "fas fa-home" }
                position:
                  oneOf:
                    - type: array
                      items: { type: string }
                    - type: string
                  example: ["menu_principal","menu_cliente"]
      responses:
        "200": { description: OK }

  /ContratoSiteMenusAdmin/save_tree:
    post:
      tags: [ContratoSiteMenusAdmin]
      summary: Salva hierarquia/ordem (nestable serialize)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contrato: { type: integer, example: 57 }
                tree:
                  type: array
                  example: [{id: 1, children: [{id: 2}]}]
      responses:
        "200": { description: OK }

  /ContratoSiteMenusAdmin/delete_item:
    post:
      tags: [ContratoSiteMenusAdmin]
      summary: Exclui item (recursivo)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contrato: { type: integer, example: 57 }
                id: { type: integer, example: 12 }
      responses:
        "200": { description: OK }