pricing-library-delete:
  delete:
    tags: [AI Pricing]
    summary: Soft-delete a pricing library item
    description: |
      Soft-deletes one pricing request owned by the authenticated user (`isDeleted: true`).

      - 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.
      - Query param `id` is the PricingRequest Mongo id.
      - Soft-deleted rows are excluded from `GET /pricing-library` and `GET /pricing-library/details`.

      <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=9967-23316&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=9967-23316&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: "9967:23316"
      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: deletePricingLibraryItem
    security:
      - SecretKeyAuth: []
        ClientBearerAuth: []
      - SecretKeyAuth: []
        ProviderBearerAuth: []
    parameters:
      - $ref: '../../openapi.yaml#/components/parameters/LangHeader'
      - name: id
        in: query
        required: true
        schema: { type: string }
        example: "665f1c2a9b4e1d0012ab34b1"
    responses:
      '200':
        description: Pricing request soft-deleted.
        content:
          application/json:
            schema: { $ref: '../../openapi.yaml#/components/schemas/PricingDeleteSuccessResponse' }
            example:
              key: success
              message: "تم حذف طلب التسعير بنجاح"
              status: 200
      '404':
        description: Pricing request not found for this user (or already deleted).
        content:
          application/json:
            schema: { $ref: '../../openapi.yaml#/components/schemas/ErrorResponse' }
            example: { key: notFound, message: "طلب التسعير غير موجود", status: 404 }
      '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 }
