/api/specimen:
  get:
    tags: [Specimen]
    summary: List specimens
    security:
      - bearerAuth: []
    responses:
      '200':
        description: List of specimens

  post:
    tags: [Specimen]
    summary: Create specimen
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/Specimen'
    responses:
      '201':
        description: Specimen created


/api/specimen/{id}:
  get:
    tags: [Specimen]
    summary: Get specimen by ID
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
    responses:
      '200':
        description: Specimen details

  patch:
    tags: [Specimen]
    summary: Update specimen
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Specimen ID (SID)
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/Specimen'
    responses:
      '200':
        description: Specimen updated

  delete:
    tags: [Specimen]
    summary: Delete specimen (soft delete)
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Specimen ID (SID)
    responses:
      '200':
        description: Specimen deleted successfully
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  example: success
                message:
                  type: string
                  example: Specimen deleted successfully
                data:
                  type: object
                  properties:
                    SID:
                      type: integer
      '404':
        description: Specimen not found
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  example: failed
                message:
                  type: string
                  example: Specimen not found
                data:
                  type: null
      '500':
        description: Server error
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  example: failed
                message:
                  type: string
                  example: Failed to delete specimen
                data:
                  type: null

/api/specimen/container:
  get:
    tags: [Specimen]
    summary: List container definitions
    security:
      - bearerAuth: []
    responses:
      '200':
        description: List of container definitions

  post:
    tags: [Specimen]
    summary: Create container definition
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/ContainerDef'
    responses:
      '201':
        description: Container definition created


/api/specimen/container/{id}:
  get:
    tags: [Specimen]
    summary: Get container definition by ID
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
    responses:
      '200':
        description: Container definition details

  patch:
    tags: [Specimen]
    summary: Update container definition
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Container definition ID (ConDefID)
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/ContainerDef'
    responses:
      '200':
        description: Container definition updated

/api/specimen/containerdef:
  get:
    tags: [Specimen]
    summary: List container definitions (alias)
    security:
      - bearerAuth: []
    responses:
      '200':
        description: List of container definitions

  post:
    tags: [Specimen]
    summary: Create container definition (alias)
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/ContainerDef'
    responses:
      '201':
        description: Container definition created


/api/specimen/containerdef/{id}:
  patch:
    tags: [Specimen]
    summary: Update container definition (alias)
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Container definition ID (ConDefID)
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/ContainerDef'
    responses:
      '200':
        description: Container definition updated

/api/specimen/prep:
  get:
    tags: [Specimen]
    summary: List specimen preparations
    security:
      - bearerAuth: []
    responses:
      '200':
        description: List of specimen preparations

  post:
    tags: [Specimen]
    summary: Create specimen preparation
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/SpecimenPrep'
    responses:
      '201':
        description: Specimen preparation created


/api/specimen/prep/{id}:
  get:
    tags: [Specimen]
    summary: Get specimen preparation by ID
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
    responses:
      '200':
        description: Specimen preparation details

  patch:
    tags: [Specimen]
    summary: Update specimen preparation
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Specimen preparation ID (SpcPrpID)
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/SpecimenPrep'
    responses:
      '200':
        description: Specimen preparation updated

/api/specimen/status:
  get:
    tags: [Specimen]
    summary: List specimen statuses
    security:
      - bearerAuth: []
    responses:
      '200':
        description: List of specimen statuses

  post:
    tags: [Specimen]
    summary: Create specimen status
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/SpecimenStatus'
    responses:
      '201':
        description: Specimen status created


/api/specimen/status/{id}:
  get:
    tags: [Specimen]
    summary: Get specimen status by ID
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
    responses:
      '200':
        description: Specimen status details

  patch:
    tags: [Specimen]
    summary: Update specimen status
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Specimen status ID (SpcStaID)
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/SpecimenStatus'
    responses:
      '200':
        description: Specimen status updated

/api/specimen/collection:
  get:
    tags: [Specimen]
    summary: List specimen collection methods
    security:
      - bearerAuth: []
    responses:
      '200':
        description: List of collection methods

  post:
    tags: [Specimen]
    summary: Create specimen collection method
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/SpecimenCollection'
    responses:
      '201':
        description: Collection method created


/api/specimen/collection/{id}:
  get:
    tags: [Specimen]
    summary: Get specimen collection method by ID
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
    responses:
      '200':
        description: Collection method details

  patch:
    tags: [Specimen]
    summary: Update specimen collection method
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Specimen collection ID (SpcColID)
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas/specimen.yaml#/SpecimenCollection'
    responses:
      '200':
        description: Collection method updated
