openapi: 3.0.3
info:
  title: TenantAtlas Operations — Bulk Enqueue (Conceptual)
  version: 0.1.0
  description: |
    Conceptual contract for enqueue-only bulk operations.

    Notes:
    - This contract describes the shape of inputs and outputs; it does not prescribe a specific Laravel route.
    - Start surfaces are enqueue-only and must not perform remote work inline.
paths:
  /operations/bulk/enqueue:
    post:
      summary: Enqueue a bulk operation (enqueue-only)
      operationId: enqueueBulkOperation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              properties:
                operation_type:
                  type: string
                  minLength: 1
                target_scope:
                  type: object
                  additionalProperties: true
                  properties:
                    entra_tenant_id:
                      type: string
                    directory_context_id:
                      type: string
                selection:
                  type: object
                  additionalProperties: true
                  properties:
                    kind:
                      type: string
                      enum: [ids, query]
                    ids:
                      type: array
                      items:
                        type: string
                    query:
                      type: object
                      additionalProperties: true
              required: [operation_type, selection]
      responses:
        '202':
          description: Enqueued or deduped to an existing active run
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  operation_run_id:
                    type: integer
                  status:
                    type: string
                    enum: [queued, running]
                  view_run_url:
                    type: string
                required: [operation_run_id, status]
