pricing-library:
  get:
    tags: [AI Pricing]
    summary: List pricing library
    description: |
      Paginated list of the authenticated user's AI pricing requests saved in the pricing library (مكتبة التسعير).

      - Requires an authenticated **client or provider** bearer token (`ClientBearerAuth` or `ProviderBearerAuth`).
      - Swagger UI exposes a **token switcher** (Client / Provider); only the selected scheme is sent.
      - Filters: `isDeleted: false`, `isHidden: false`, `savedToLibrary: true`, owned by `req.user`.
      - Each card includes `detailsButton` and `deleteButton`.
      - Soft-deleted items (`DELETE /pricing-library/delete`) never appear here.
      - Sorted newest first via `ApiFeature`.

      <div class="figma-links"><span>Design:</span><a href="https://www.figma.com/proto/mTRILiWaS8pzLcNnmAUr2k/%D9%83%D9%85-%D8%AA%D8%B3%D9%88%D9%8A?node-id=9980-22150&viewport=176%2C570%2C0.02&t=c4yTtQLlUc9FQir5-1&scaling=scale-down&content-scaling=fixed&starting-point-node-id=9064%3A6087&page-id=0%3A1" target="_blank" rel="noopener">Mobile</a><a href="https://www.figma.com/proto/mTRILiWaS8pzLcNnmAUr2k/%D9%83%D9%85-%D8%AA%D8%B3%D9%88%D9%8A?page-id=10227%3A31854&node-id=10762-100498&viewport=-948%2C0%2C0.12&t=PNIRCKFxGV24peHK-1&scaling=min-zoom&content-scaling=fixed&starting-point-node-id=10449%3A65038" target="_blank" rel="noopener">Web</a></div>
    x-figma:
      mobile: "https://www.figma.com/proto/mTRILiWaS8pzLcNnmAUr2k/%D9%83%D9%85-%D8%AA%D8%B3%D9%88%D9%8A?node-id=9980-22150&viewport=176%2C570%2C0.02&t=c4yTtQLlUc9FQir5-1&scaling=scale-down&content-scaling=fixed&starting-point-node-id=9064%3A6087&page-id=0%3A1"
      mobileNodeId: "9980:22150"
      web: "https://www.figma.com/proto/mTRILiWaS8pzLcNnmAUr2k/%D9%83%D9%85-%D8%AA%D8%B3%D9%88%D9%8A?page-id=10227%3A31854&node-id=10762-100498&viewport=-948%2C0%2C0.12&t=PNIRCKFxGV24peHK-1&scaling=min-zoom&content-scaling=fixed&starting-point-node-id=10449%3A65038"
      webNodeId: "10762:100498"
    operationId: listPricingLibrary
    security:
      - SecretKeyAuth: []
        ClientBearerAuth: []
      - SecretKeyAuth: []
        ProviderBearerAuth: []
    parameters:
      - $ref: '../../openapi.yaml#/components/parameters/LangHeader'
      - name: page
        in: query
        required: false
        schema: { type: integer, minimum: 1, default: 1 }
      - name: limit
        in: query
        required: false
        schema: { type: integer, minimum: 1, maximum: 100, default: 10 }
    responses:
      '200':
        description: Pricing library page.
        content:
          application/json:
            schema:
              $ref: '../../openapi.yaml#/components/schemas/PricingLibraryListResponse'
            example:
              key: success
              message: "مكتبة التسعير"
              status: 200
              data:
                - id: "665f1c2a9b4e1d0012ab34b1"
                  name: "آيفون 13"
                  image: "https://dashboard.kam-teswa.4hoste.com/assets/uploads/users/providers/pricing-requests/665f1c2a9b4e1d0012ab34b1/image901785232499932.png"
                  specifications: "اللون أسود"
                  suggestedPrice: 450
                  suggestedPriceTXT: "450 ﷼"
                  priceRangeMin: 383
                  priceRangeMax: 518
                  currency: "﷼"
                  createdAt: "2026/07/28 11:00 صباحا"
                  detailsButton: true
                  deleteButton: true
              paginate:
                currentPage: 1
                lastPage: 1
                perPage: 10
                total: 1
      '419':
        description: Unauthorized.
        content:
          application/json:
            schema: { $ref: '../../openapi.yaml#/components/schemas/ErrorResponse' }
            example: { key: unauthorized, message: "يجب تسجيل الدخول", status: 419 }
      '500': { $ref: '#/shared-server-error' }

shared-server-error:
  description: Unexpected server error.
  content:
    application/json:
      schema: { $ref: '../../openapi.yaml#/components/schemas/ErrorResponse' }
      example: { key: exception, message: "حدث خطأ ما", status: 500 }
