---
openapi: 3.1.0
components:
  schemas:
    Brand:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        supplier:
          $ref: "#/components/schemas/Supplier"
    Params:
      type: object
      properties:
        q:
          type: string
    ProductSearchResponse:
      type: object
      properties:
        id:
          type: string
        customPrice:
          type: integer
          format: int32
        deleted:
          type: integer
          format: int32
        isWebshopProduct:
          type: integer
          format: int32
        desiredStockBalance:
          type: integer
          format: int32
        inPrice:
          type: number
          format: double
        incomingStock:
          type: integer
          format: int32
        price:
          type: number
          format: double
        product:
          type: string
        description:
          type: string
        series:
          type: string
        supplier:
          type: string
        brand:
          $ref: "#/components/schemas/Brand"
        salon:
          type: string
        size:
          type: string
        stock:
          type: integer
          format: int32
        title:
          type: string
        weight:
          type: string
        imageUrl:
          type: string
        owner:
          type: string
        VAT:
          type: integer
          format: int32
    RepsonseHeader:
      type: object
      properties:
        zkConnected:
          type: boolean
        status:
          type: integer
          format: int32
        QTime:
          type: integer
          format: int32
        params:
          $ref: "#/components/schemas/Params"
    ResponseProductSearchResponse:
      type: object
      properties:
        numFound:
          type: integer
          format: int32
        start:
          type: integer
          format: int32
        docs:
          type: array
          items:
            $ref: "#/components/schemas/ProductSearchResponse"
    SolrQueryResponseProductSearchResponse:
      type: object
      properties:
        responseHeader:
          $ref: "#/components/schemas/RepsonseHeader"
        response:
          $ref: "#/components/schemas/ResponseProductSearchResponse"
    Supplier:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
  securitySchemes:
    SecurityScheme:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authentication
paths:
  /api/search/products:
    get:
      parameters:
      - name: barcode
        in: query
        schema:
          type: string
      - name: brandId
        in: query
        schema:
          type: string
      - name: deleted
        in: query
        schema:
          type: boolean
      - name: hasPrice
        in: query
        schema:
          type: boolean
      - name: includeAllSalons
        in: query
        schema:
          type: boolean
      - name: input
        in: query
        schema:
          type: string
      - name: isWebshopProduct
        in: query
        schema:
          type: boolean
      - name: limit
        in: query
        schema:
          type: integer
          format: int32
          minimum: 0
      - name: offset
        in: query
        schema:
          type: integer
          format: int32
          minimum: 0
      - name: order
        in: query
        schema:
          type: string
          pattern: ^(asc|desc)$
      - name: owner
        in: query
        schema:
          type: string
      - name: salonId
        in: query
        schema:
          type: string
          pattern: \S
        required: true
      - name: "series[]"
        in: query
        schema:
          type: array
          items:
            type: string
      - name: sort
        in: query
        schema:
          type: string
          pattern: ^(inPrice|price|stock|discontinuationDate|title)$
      - name: supplierId
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SolrQueryResponseProductSearchResponse"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Products
      tags:
      - Product Search Resource
      security:
      - SecurityScheme: []
info:
  title: voady-search-service API
  version: 1.0.0-SNAPSHOT
