/api/equipmentlist:
  get:
    tags: [Equipment]
    summary: List equipment
    description: Get list of equipment with optional filters
    security:
      - bearerAuth: []
    parameters:
      - name: IEID
        in: query
        schema:
          type: string
        description: Filter by IEID
      - name: InstrumentName
        in: query
        schema:
          type: string
        description: Filter by instrument name
      - name: DepartmentID
        in: query
        schema:
          type: integer
        description: Filter by department ID
      - name: WorkstationID
        in: query
        schema:
          type: integer
        description: Filter by workstation ID
      - name: Enable
        in: query
        schema:
          type: integer
          enum: [0, 1]
        description: Filter by enable status
    responses:
      '200':
        description: List of equipment
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                message:
                  type: string
                data:
                  type: array
                  items:
                    $ref: '../components/schemas/equipmentlist.yaml#/EquipmentList'

  post:
    tags: [Equipment]
    summary: Create equipment
    description: Create a new equipment entry
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - IEID
              - DepartmentID
              - Enable
              - EquipmentRole
            properties:
              IEID:
                type: string
                maxLength: 50
              DepartmentID:
                type: integer
              InstrumentID:
                type: string
                maxLength: 150
              InstrumentName:
                type: string
                maxLength: 150
              WorkstationID:
                type: integer
              Enable:
                type: integer
                enum: [0, 1]
              EquipmentRole:
                type: string
                maxLength: 1
    responses:
      '201':
        description: Equipment created
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                message:
                  type: string
                data:
                  type: integer


  delete:
    tags: [Equipment]
    summary: Delete equipment
    description: Soft delete an equipment entry
    security:
      - bearerAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - EID
            properties:
              EID:
                type: integer
    responses:
      '200':
        description: Equipment deleted
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                message:
                  type: string

/api/equipmentlist/{id}:
  get:
    tags: [Equipment]
    summary: Get equipment by ID
    description: Get a single equipment entry by its EID
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Equipment ID
    responses:
      '200':
        description: Equipment details
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                message:
                  type: string
                data:
                  $ref: '../components/schemas/equipmentlist.yaml#/EquipmentList'

  patch:
    tags: [Equipment]
    summary: Update equipment
    description: Update an existing equipment entry
    security:
      - bearerAuth: []
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Equipment ID
    requestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              IEID:
                type: string
                maxLength: 50
              DepartmentID:
                type: integer
              InstrumentID:
                type: string
                maxLength: 150
              InstrumentName:
                type: string
                maxLength: 150
              WorkstationID:
                type: integer
              Enable:
                type: integer
                enum: [0, 1]
              EquipmentRole:
                type: string
                maxLength: 1
    responses:
      '200':
        description: Equipment updated
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                message:
                  type: string
                data:
                  type: integer
